Freelancer: vhts09
Share:
Report Entry

Thousand Combos v0.3

I got to trim some stuff and here's the result. I am sorting some values and if you select only 6 values to be used, I think it's the best solution as it takes only around 23 seconds and it is only 0.36% of the theoretical best value which took 935 seconds to run with 20 values. I am sending a picture of the first 5 results, but I have the other 1000 best values.

Contest Entry #4 for                                                 BEST PHP script to select the best 1000 combinations of elements based on some constraints (maybe linear programming and/or sort algorithm is needed)

Public Clarification Board

  • juanjodelagarza
    Contest Holder
    • 3 years ago

    Hi, Victor, thanks for your proposal.

    The data i shared on the screenshot is only a sample of the amount of data i'm going to play with which is around 600 elements, and the weights are changing every time i execute it, the tokens sometimes.

    The reason i made this requirement a contest is to compare scripts and choose the best. To be honest with the information you shared i can't know if the result is correct and how efficient is your script. I understand that you don't want that someone that doesn't paid for your script own it, but that's the reason I Guaranteed the prize, to give the contenders the confidence that if their script is the best, there would be a guaranteed retribution.

    • 3 years ago
    1. vhts09
      vhts09
      • 3 years ago

      Thank you for the feedback.

      The results that I shared, varying the number of chosen elements per type, is to demonstrate the balance between accuracy and time spent calculating it. Say you want to calculate all the millions of combinations now this way will guarantee you the best answer, but it will take a lot of time to do so. Now if you only use the best answers for each element, you will calculate first 600 elements, choose only the necessary to build 1000 distinct combination. In this case you’ll need around 6 elements for each type to have 6^4 = 1296 combinations. Therefore in total the number of function executions is only 1896. This balance is what I tried to show you by plotting the number of elements used per type and it’s runtime and best result.

      It leads me to believe that you can have an optimal solution with only 6 elements (20s to run) that it will have a difference of under 0.5% of a solution with 20 elements (935s to run).

      • 3 years ago
    2. vhts09
      vhts09
      • 3 years ago

      Is there a way for you to contact me here on Freelancer through a message so I can share with you my script?

      • 3 years ago
  • vhts09
    vhts09
    • 3 years ago

    Keep in mind that these weight values are generated randomly. If you award me this contest you can run with you own CSV file. I run with random numbers to check convergence for all scenarios.

    • 3 years ago