Interface Graph<ID>

  • Type Parameters:
    ID - type of all identifiers in graph
    All Known Subinterfaces:
    EventGraph<ID>
    All Known Implementing Classes:
    AbstractGraph, DirectedGraph, UndirectedGraph

    public interface Graph<ID>
    A graph is composed of vertices and edges. A vertex is able to connect to other vertices through edges. Edges connect two vertices. A graph can be directed or undirected.

    Vertices have an 'id' which uniquely identifies the vertex within the graph. Edges have a 'to' and 'from' property which are the ids of the vertex endpoints. Edges are optionally identified.

    At all times the graph is valid event when removing connected vertices.

    Undirected graphs ignore 'from'/'to' order in edges.

    Once a vertex or edge is removed it can no longer modify the graph or be modified.