Builds a minimum spanning tree (Kruskal) over all intersections — Highway generator.
More...
#include <HighwayGenerator.h>
Builds a minimum spanning tree (Kruskal) over all intersections — Highway generator.
- Note
- This implementation deviates from the standard Kruskal algorithm by enforcing a planar constraint: edges are only added when both directed variants (A->B and B->A) can be inserted without crossing existing roads. As a result, it does not always produce the exact minimum spanning tree as returned by a pure Kruskal run.
◆ HighwayGenerator()
HighwayGenerator::HighwayGenerator |
( |
int |
defaultSpeed | ) |
|
|
explicit |
- Parameters
-
defaultSpeed | Speed for every new Road. |
◆ generate()
Append new bidirectional highways into the graph (no duplicates).
Implements RoadGenerator.
The documentation for this class was generated from the following files: