The algorithm for finding the best food distribution routes in the game

I design a game in urban construction and got into a problem.

Imagine the game mechanics of Sierra Caesar III: you have many urban districts with one market. At a distance associated with the oriented weighted graph, there are several granaries. The difference: people (cars here) are the units that form traffic jams (here the weight of the chart goes).

Note: in the Ceasar series of games, people collected food and stored it in several large granaries, while many markets (small shops) took food from the granaries and delivered it to citizens.

Objective : to tell each district where they should receive food with minimum time and minimize congestion on city roads.

Map example

Example graph diagram

, 7, 7 4 . 7 11 .

, . - , . , 4 1- 3- 2- , 4 2- .

, .

? ( : ..), , .

+5
6

Max-flow. , , .

+6

, , -, . solutions .

+4

, , , , . - ant .

, node , node, node, node, , node, node.

+4

, , , .

, (), , , .

( ) , .

- , dev, , , .

: , Mathmike Wikipedia , .

+2

-, , , . X t (: ), , Max Flow , , , , , t + 1 X. (1 , ).

( , , 25% ), : , - (, 1 1 , ) - ( ) , , . N .

( Max Max ), , .

0

, , , , , . , . , A B, ? :

  • , , . , , .

  • , . , .

  • , / . , .

, , . , , , , .

0

All Articles