Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm attempting to create an algorithm to address an issue that I can't categorize, therefore I'll reveal the subject:

You have a map divided into parts with a specific area and a specific number of inhabitants.

The challenge is to identify sets of connected sections whose area does not exceed a particular amount while maximizing the number of chosen occupants.

Another strategy:
Furthermore, based on the combinatorics of the specific issue, it is possible in some instances to use genetic algorithms in conjunction with tabu search, but only in situations where finding an optimum answer is impossible.

To be more specific, the goal is to obtain a set of connected sections whose sum of areas does not exceed the total area. The population sum of the chosen sections is the parameter to maximize. The goal is to discover the best option.

What I have tried:

For the time being, I can think of two approaches:

Treat the problem as an all-pairs shortest routes problem in an undirected network with positive natural values, and discard solutions that do not match the constraint of the largest chosen area. You might use the Floyd-Warshall algorithm, Dijkstra for all pairings, or Thorup method (which can be done in time V * E, where V and E are the graph's vertices and edges).

Consider it a profit-generating open vehicle routing problem in which each vehicle can start and stop anywhere it wishes. (open vehicle routing problem with profits or OVRPP).
Posted
Updated 29-Mar-23 0:00am
Comments
OriginalGriff 29-Mar-23 6:00am    
And?
What have you tried?
Where are you stuck?
What help do you need?

Use the "Improve question" widget to edit your question and provide better information.
[no name] 29-Mar-23 12:02pm    
Identify all "connected" sections and the combinations that "fit" (bin packing). Then take the combination with the highest population.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900