Interface UnweightedGraph<V>

Type Parameters:
V - Type of vertices.
All Superinterfaces:
Graph<V>, java.io.Serializable
All Known Subinterfaces:
DirectedUnweightedGraph<V>, DirectedUnweightedMultiGraph<V>, UndirectedUnweightedGraph<V>, UndirectedUnweightedMultiGraph<V>, UnweightedMultiGraph<V>, UnweightedTree<U>
All Known Implementing Classes:
DirectedJungGraph, DirectedUnweightedComplementaryGraph, FastDirectedUnweightedGraph, FastDirectedUnweightedMultiGraph, FastUndirectedUnweightedGraph, FastUndirectedUnweightedMultiGraph, FastUnweightedTree, JungGraph, UndirectedJungGraph, UndirectedUnweightedComplementaryGraph

public interface UnweightedGraph<V>
extends Graph<V>
Interface for directed graphs.
  • Method Details

    • getIncidentNodesWeights

      default java.util.stream.Stream<Weight<V,​java.lang.Double>> getIncidentNodesWeights​(V node)
      Given a node, finds all the nodes u such that the edge (u to node) is in the graph.
      Specified by:
      getIncidentNodesWeights in interface Graph<V>
      Parameters:
      node - The node.
      Returns:
      a stream of the incident nodes.
    • getAdjacentNodesWeights

      default java.util.stream.Stream<Weight<V,​java.lang.Double>> getAdjacentNodesWeights​(V node)
      Given a node, finds all the nodes u such that the edge (node to u) is in the graph.
      Specified by:
      getAdjacentNodesWeights in interface Graph<V>
      Parameters:
      node - The node.
      Returns:
      a stream containing the adjacent nodes.
    • getNeighbourNodesWeights

      default java.util.stream.Stream<Weight<V,​java.lang.Double>> getNeighbourNodesWeights​(V node)
      Given a node, finds all the nodes u so that either (node to u) or (u to node) are in the graph.
      Specified by:
      getNeighbourNodesWeights in interface Graph<V>
      Parameters:
      node - The node.
      Returns:
      a stream containing all the nodes in the neighbourhood.
    • getMutualNodesWeights

      default java.util.stream.Stream<Weight<V,​java.lang.Double>> getMutualNodesWeights​(V node)
      Given a node, finds all the nodes u so that either (node to u) or (u to node) are in the graph.
      Specified by:
      getMutualNodesWeights in interface Graph<V>
      Parameters:
      node - The node.
      Returns:
      a stream containing all the nodes in the neighbourhood.
    • getAdjacentMutualNodesWeights

      default java.util.stream.Stream<Weight<V,​java.lang.Double>> getAdjacentMutualNodesWeights​(V node)
      Given a node, finds all the nodes u so that either (node to u) or (u to node) are in the graph.
      Specified by:
      getAdjacentMutualNodesWeights in interface Graph<V>
      Parameters:
      node - The node.
      Returns:
      A stream containing all the nodes in the neighbourhood.
    • getIncidentMutualNodesWeights

      default java.util.stream.Stream<Weight<V,​java.lang.Double>> getIncidentMutualNodesWeights​(V node)
      Given a node, finds all the nodes u so that either (node to u) or (u to node) are in the graph.
      Specified by:
      getIncidentMutualNodesWeights in interface Graph<V>
      Parameters:
      node - The node.
      Returns:
      a stream containing all the nodes in the neighbourhood.
    • getEdgeWeight

      default double getEdgeWeight​(V incident, V adjacent)
      Description copied from interface: Graph
      Obtains the weight of an edge in the graph
      Specified by:
      getEdgeWeight in interface Graph<V>
      Parameters:
      incident - The incident node.
      adjacent - The adjacent node.
      Returns:
      The corresponding weight. If the edge does not exist, NaN
    • addEdge

      default boolean addEdge​(V nodeA, V nodeB, double weight, int type)
      Description copied from interface: Graph
      Adds a new edge to the graph. If nodes do not exist, they are added.
      Specified by:
      addEdge in interface Graph<V>
      Parameters:
      nodeA - The incident node.
      nodeB - The adjacent node.
      weight - The weight of the edge.
      type - The edge type.
      Returns:
      true if the edge is correctly added, false if not.
    • isWeighted

      default boolean isWeighted()
      Description copied from interface: Graph
      Indicates if the graph is weighted.
      Specified by:
      isWeighted in interface Graph<V>
      Returns:
      true if it is, false if not.