Interface Graph

    • Method Detail

      • getEdges

        java.util.List<Edge> getEdges​(Node node)
        Returns a list of edges connected to this node
        Parameters:
        node -
        Returns:
        the set of nodes that are attached by edges to the given node.
      • getAdjacencies

        java.util.List<Node> getAdjacencies​(Node node)
        Returns a list of nodes connected to this node by an edge
        Parameters:
        node -
        Returns:
        the set of nodes that are attached by edges to the given node.
      • getEdgeLength

        double getEdgeLength​(Node node1,
                             Node node2)
                      throws Graph.NoEdgeException
        Returns the length of the edge that connects these two nodes
        Parameters:
        node1 -
        node2 -
        Returns:
        the edge length.
        Throws:
        Graph.NoEdgeException - if the nodes are not directly connected by an edge.
      • getNodes

        Node[] getNodes​(Edge edge)
        Returns an array of 2 nodes which are the nodes at either end of the edge.
        Parameters:
        edge -
        Returns:
        an array of 2 edges
      • getNodes

        java.util.Set<Node> getNodes()
        Returns:
        the set of all nodes in this graph.
      • getEdges

        java.util.Set<Edge> getEdges()
        Returns:
        the set of all edges in this graph.
      • getNodes

        java.util.Set<Node> getNodes​(int degree)
        Parameters:
        degree - the number of edges connected to a node
        Returns:
        a set containing all nodes in this graph of the given degree.