Interface MultiGraph<U>

Type Parameters:
U - Type of the users
All Superinterfaces:
Graph<U>, java.io.Serializable
All Known Subinterfaces:
DirectedMultiGraph<U>, DirectedUnweightedMultiGraph<V>, DirectedWeightedMultiGraph<U>, FastMultiGraph<U>, UndirectedMultiGraph<V>, UndirectedUnweightedMultiGraph<V>, UndirectedWeightedMultiGraph<V>, UnweightedMultiGraph<V>, WeightedMultiGraph<V>
All Known Implementing Classes:
AbstractFastMultiGraph, FastDirectedUnweightedMultiGraph, FastDirectedWeightedMultiGraph, FastUndirectedUnweightedMultiGraph, FastUndirectedWeightedMultiGraph

public interface MultiGraph<U>
extends Graph<U>
Interface for representing multigraphs
  • Method Details

    • getNumEdges

      int getNumEdges​(U nodeA, U nodeB)
      Gets the number of edges between two nodes, A and B.
      Parameters:
      nodeA - The first node of the pair.
      nodeB - The second node of the pair.
      Returns:
      The number of edges between the nodes.
    • getEdgeWeights

      java.util.List<java.lang.Double> getEdgeWeights​(U nodeA, U nodeB)
      Gets the weights of the different edges between two nodes, A and B.
      Parameters:
      nodeA - The first node of the pair.
      nodeB - THe second node of the pair.
      Returns:
      The number of edges between the nodes.
    • getIncidentNodesWeightsLists

      java.util.stream.Stream<Weights<U,​java.lang.Double>> getIncidentNodesWeightsLists​(U node)
      Gets the different weights for the edges of the incident nodes.
      Parameters:
      node - The node to study
      Returns:
      A stream containing the weights
    • getAdjacentNodesWeightsLists

      java.util.stream.Stream<Weights<U,​java.lang.Double>> getAdjacentNodesWeightsLists​(U node)
      Gets the different weights for the edges of the adjacent nodes.
      Parameters:
      node - The node to study
      Returns:
      A stream containing the weights
    • getNeighbourNodesWeightsLists

      java.util.stream.Stream<Weights<U,​java.lang.Double>> getNeighbourNodesWeightsLists​(U node)
      Gets the different weights for the edges of the neighbour nodes.
      Parameters:
      node - The node to study
      Returns:
      A stream containing the weights
    • getNeighbourhoodWeightsLists

      java.util.stream.Stream<Weights<U,​java.lang.Double>> getNeighbourhoodWeightsLists​(U node, EdgeOrientation orientation)
      Gets the different weights for the edges of the selected neighbour nodes.
      Parameters:
      node - The node to study
      orientation - The orientation to take
      Returns:
      A stream containing the weights
    • getEdgeTypes

      java.util.List<java.lang.Integer> getEdgeTypes​(U nodeA, U nodeB)
      Gets the weights of the different edges between two nodes, A and B.
      Parameters:
      nodeA - The first node of the pair.
      nodeB - THe second node of the pair.
      Returns:
      The number of edges between the nodes.
    • getIncidentNodesTypesLists

      java.util.stream.Stream<Weights<U,​java.lang.Integer>> getIncidentNodesTypesLists​(U node)
      Gets the different weights for the edges of the incident nodes.
      Parameters:
      node - The node to study
      Returns:
      A stream containing the weights
    • getAdjacentNodesTypesLists

      java.util.stream.Stream<Weights<U,​java.lang.Integer>> getAdjacentNodesTypesLists​(U node)
      Gets the different weights for the edges of the adjacent nodes.
      Parameters:
      node - The node to study
      Returns:
      A stream containing the weights
    • getNeighbourNodesTypesLists

      java.util.stream.Stream<Weights<U,​java.lang.Integer>> getNeighbourNodesTypesLists​(U node)
      Gets the different weights for the edges of the neighbour nodes.
      Parameters:
      node - The node to study
      Returns:
      A stream containing the weights
    • getNeighbourhoodTypesLists

      java.util.stream.Stream<Weights<U,​java.lang.Integer>> getNeighbourhoodTypesLists​(U node, EdgeOrientation orientation)
      Gets the different weights for the edges of the selected neighbour nodes.
      Parameters:
      node - The node to study
      orientation - The orientation to take
      Returns:
      A stream containing the weights
    • isMultigraph

      default boolean isMultigraph()
      Description copied from interface: Graph
      Indicates if the graph is a multigraph (by default, it is not).
      Specified by:
      isMultigraph in interface Graph<U>
      Returns:
      true if it is, false if not.
    • removeEdge

      default boolean removeEdge​(U nodeA, U nodeB, int idx)
      Removes an edge from the graph.
      Parameters:
      nodeA - The incident node of the edge to remove.
      nodeB - The adjacent node of the edge to remove.
      idx - The number of the edge to remove.
      Returns:
      true if everything went ok, false if not.
    • removeEdges

      default boolean removeEdges​(U nodeA, U nodeB)
      Deletes all the edges between a pair of nodes.
      Parameters:
      nodeA - The incident node of the edges to remove.
      nodeB - The adjacent node of the edges to remove.
      Returns:
      true if everything went ok, false otherwise.
    • updateEdgeWeight

      boolean updateEdgeWeight​(int orig, int dest, double weight, int idx)
      Updates the weight of an edge from the graph.
      Parameters:
      orig - The incident node of the edge to remove.
      dest - The adjacent node of the edge to remove.
      weight - the new weight for the edge.
      idx - The number of the edge to remove.
      Returns:
      true if everything went ok, false if not.