Following the challenge of creating a route simulator in knime, I found a possibility that could suit me and that will be easier to manipulate and create.

I have 4 tables that needed to be crossed to get the final result.

Important points:

The route can have up to 17 stops.

Maximum vehicle capacity

Whichever comes first

1° I need to define the vehicle profile for each route. We have the “Collection points” table with all the stop information ( Shop_id ), and the number of cars available table with the number of cars available per region and the table a

Example :

The BIRIGUI region has 1 TRUCK available, and its capacity (P90) is 7253, I need us to have a route with either 17 stops or up to the value of the “orders_pickup” column
" reach this value.

Points of attention, the Collection points table is ranked, we can consider the next 17 SHOP_ID, as long as it is from the same SOC. However, for the vehicle’s capacity, we need to understand which one makes the most sense for each route, because there are routes that will have a larger volume and others that will have a smaller volume.

NOTE: If there is no vehicle to travel the route, you can include more as long as the profile has the largest quantity.

Example: there are 44 vehicles available in Birigui, 26 of which are vans in Birigui. If we need 47 routes, the additional 3 must use a van as a profile.

Follow the flow below, thanks in advance for your help

Hi @Gabriel2020 , I’m sorry but I don’t have the headspace at the moment for this problem.

A few points though which might help with finding somebody else to help you:

On a quick read, and looking at your uploaded data, I haven’t actually worked out what form of the output you are looking for. Can you clarify or give more detail about the expected output.

I don’t understand what “rules” or algorithm you would have for determining the results, or what your data tables mean. That may be because I haven’t spent much time on this, but if you can give a description of how you would go about working out an example manually then it may give better understanding of what is required. For example when you said “if we need 47 routes, the additional 3 must use a van as a profile”, why must they?

I get the feeling that maybe you have some other detail that you have written elsewhere which is possibly why I am missing something. Should this question be read in conjunction with something else you have already posted?

If as @MartinDDDD suggests, this is requiring a Linear Programming type solution, then have you looked at the examples he has suggested. I confess I haven’t done any Linear Programming since I was at school (40+ years ago) so I get the idea but I’m a bit rusty and back then we only had a pencil and graph paper

Thanks for your faith in me, and sorry not to be of much help right now but if you can give more clarity perhaps somebody else can assist, or I may be able to return to this in future.