Skip to content

Energy Distribution Grid: Graph Representation #472

@Indy2222

Description

@Indy2222

As a first step, lets make this extremely simple:

  • Energy distribution grid is represented as an un-directed graph.
  • The graph may consist of multiple connected components.
  • Edges in the graph represent energy interlinks. I.e. power may flow from node to node over the edges.
  • Nodes in the graph are buildings & units.
  • Every two neighboring nodes in the graph:
    • Are entities whose distance is less than X meters.
    • At least one of them is a power hub.
  • The graph is maximal in respect to the above condition. I.e. when the conditions are met, then the two entities must be neighbors in the graph.
  • The graph representation allows:
    • Updating with every game tick (despawned entities are removed, spawned entities are added, neighbors are updated for moving entities).
    • Is efficient: thousands of moving units should not cause massive resource usage.
    • Supports common graph algorithms. Especially maximum flow and related algorithms.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions