Select a list than complies with a specific criteria

Hello! I have been working on developing a free access logic for the selection of formwork elements in the construction con reinforced concrete elements.

I am currently facing an issue regarding the “selection of the path” or the type of formwork once the most optimal combinations of panels have been conducted.

The most basic scheme of the problem is this one: where I have no idea how to actually establish a path.

I have been trying different ways to solve without even being close to success. Any help or guidance on which nodes can i use for the particular task i specify there would be greatly appreciated. The whole script is also attached, though it may be a little confusing.
Cast in Place Element Selector v6.0.dyn (185.8 KB)

If I’m understanding your question correctly, you already have all your data, you just need to figure out how to apply the logic to select the best option.

  1. You would take your Capacity values and check them against your Target. Use a boolean mask to filter only the options that are greater.
  2. Take your filtered list of options and use SortByKey to sort your options by Cost. Then take the first option (the lowest cost) as your best choice.