-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GSoC 2022: Manas Sivakumar Third and Fourth Week #225
Conversation
for knapsack_driver.h in include/or-tools do I have to make my own c_type structures as well?
|
Q: Why do you want to access other data points like coordinates, vehicle_id for your knapsack function? For the structure of your function, there are following possibilities:
I think the third approach is not a good one, because why run an SQL query for a table having a single column? You can go with either the 1st or the 2nd option. The 1st approach is intuitive because say a user has a table with all the item details, then for the knapsack function, the user can fetch two columns from that table. The 2nd approach is also okay, because any way you just require weight and value for the knapsack, and don't need any additional data, so both of these values can be fed in the form of an array. Though in this approach, you need to do an extra check that the length of weight and value arrays are the same. Yes, if such a struct does not exist, then you have to create it. |
orders_sql TEXT, | ||
max_vehicles INTEGER, | ||
capacity FLOAT, | ||
weights_sql TEXT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Putting this kind of comments that are based on the sql, are useless in the C/C++ code
becuase if you change the sql then you need to look for the comments and modify accordingly.
it just implies more work for you
My question was not very clear. I updated it now. But I think you answered my question. Is there any need for a table with additional data columns other than weights and values ? I assume if people want to use the or-tools knapsack implementation they will be having a huge number of items so asking them to enter it as parameters would be difficult |
Changes proposed in this pull request: