Interface WeightedGraph<V>

Type Parameters:
V - Type of vertices.
All Superinterfaces:
Graph<V>, java.io.Serializable
All Known Subinterfaces:
DirectedWeightedGraph<V>, DirectedWeightedMultiGraph<U>, UndirectedWeightedGraph<V>, UndirectedWeightedMultiGraph<V>, WeightedMultiGraph<V>, WeightedTree<U>
All Known Implementing Classes:
DirectedWeightedComplementaryGraph, FastDirectedWeightedGraph, FastDirectedWeightedMultiGraph, FastUndirectedWeightedGraph, FastUndirectedWeightedMultiGraph, FastWeightedTree, UndirectedWeightedComplementaryGraph

public interface WeightedGraph<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.
    • 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.