Interface MutableDirectedGraph<N>

    • Method Detail

      • addEdge

        void addEdge​(N from,
                     N to)
        Adds an edge to the graph between 2 nodes. If the edge is already present no change is made.
        Parameters:
        from - out node for the edge.
        to - in node for the edge.
      • removeEdge

        void removeEdge​(N from,
                        N to)
        Removes an edge between 2 nodes in the graph. If the edge is not present no change is made.
        Parameters:
        from - out node for the edge to remove.
        to - in node for the edge to remove.
      • containsEdge

        boolean containsEdge​(N from,
                             N to)
        Returns:
        true if the graph contains an edge the 2 nodes false otherwise.
      • getNodes

        List<N> getNodes()
        Returns:
        a list of the nodes that compose the graph. No ordering is implied.
      • addNode

        void addNode​(N node)
        Adds a node to the graph. Initially the added node has no successors or predecessors. ; as a consequence it is considered both a head and tail for the graph.
        Parameters:
        node - a node to add to the graph.
        See Also:
        DirectedGraph.getHeads(), DirectedGraph.getTails()
      • removeNode

        void removeNode​(N node)
        Removes a node from the graph. If the node is not found in the graph, no change is made.
        Parameters:
        node - the node to be removed.
      • containsNode

        boolean containsNode​(N node)
        Parameters:
        node - node that we want to know if the graph constains.
        Returns:
        true if the graph contains the node. false otherwise.