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 Summary
Modifier and Type Method Description java.util.stream.Stream<Weights<U,java.lang.Integer>>
getAdjacentNodesTypesLists(U node)
Gets the different weights for the edges of the adjacent nodes.java.util.stream.Stream<Weights<U,java.lang.Double>>
getAdjacentNodesWeightsLists(U node)
Gets the different weights for the edges of the adjacent nodes.java.util.List<java.lang.Integer>
getEdgeTypes(U nodeA, U nodeB)
Gets the weights of the different edges between two nodes, A and B.java.util.List<java.lang.Double>
getEdgeWeights(U nodeA, U nodeB)
Gets the weights of the different edges between two nodes, A and B.java.util.stream.Stream<Weights<U,java.lang.Integer>>
getIncidentNodesTypesLists(U node)
Gets the different weights for the edges of the incident nodes.java.util.stream.Stream<Weights<U,java.lang.Double>>
getIncidentNodesWeightsLists(U node)
Gets the different weights for the edges of the incident nodes.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.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.java.util.stream.Stream<Weights<U,java.lang.Integer>>
getNeighbourNodesTypesLists(U node)
Gets the different weights for the edges of the neighbour nodes.java.util.stream.Stream<Weights<U,java.lang.Double>>
getNeighbourNodesWeightsLists(U node)
Gets the different weights for the edges of the neighbour nodes.int
getNumEdges(U nodeA, U nodeB)
Gets the number of edges between two nodes, A and B.default boolean
isMultigraph()
Indicates if the graph is a multigraph (by default, it is not).default boolean
removeEdge(U nodeA, U nodeB, int idx)
Removes an edge from the graph.default boolean
removeEdges(U nodeA, U nodeB)
Deletes all the edges between a pair of nodes.boolean
updateEdgeWeight(int orig, int dest, double weight, int idx)
Updates the weight of an edge from the graph.Methods inherited from interface es.uam.eps.ir.relison.graph.Graph
addEdge, addEdge, addEdge, addEdge, addEdge, addEdge, addNode, complement, containsEdge, containsVertex, degree, degree, getAdjacencyMatrix, getAdjacencyMatrixMap, getAdjacentEdgesCount, getAdjacentMutualNodesTypes, getAdjacentMutualNodesWeights, getAdjacentNodes, getAdjacentNodesCount, getAdjacentNodesTypes, getAdjacentNodesWeights, getAllNodes, getEdgeCount, getEdgeType, getEdgeWeight, getIncidentEdgesCount, getIncidentMutualNodesTypes, getIncidentMutualNodesWeights, getIncidentNodes, getIncidentNodesCount, getIncidentNodesTypes, getIncidentNodesWeights, getIsolatedNodes, getMutualEdgesCount, getMutualNodes, getMutualNodesCount, getMutualNodesTypes, getMutualNodesWeights, getNeighbourEdgesCount, getNeighbourhood, getNeighbourhoodSize, getNeighbourhoodTypes, getNeighbourhoodWeights, getNeighbourNodes, getNeighbourNodesCount, getNeighbourNodesTypes, getNeighbourNodesWeights, getNodesWithAdjacentNeighbors, getNodesWithIncidentNeighbors, getNodesWithMutualNeighbors, getNodesWithNeighbors, getNodesWithNeighbors, getVertexCount, hasAdjacentNeighbors, hasIncidentNeighbors, hasMutualNeighbors, hasNeighbors, hasNeighbors, inDegree, isDirected, isMutual, isWeighted, mutualDegree, outDegree, removeEdge, removeNode, updateEdgeType, updateEdgeWeight
-
Method Details
-
getNumEdges
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
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
Gets the different weights for the edges of the incident nodes.- Parameters:
node
- The node to study- Returns:
- A stream containing the weights
-
getAdjacentNodesWeightsLists
Gets the different weights for the edges of the adjacent nodes.- Parameters:
node
- The node to study- Returns:
- A stream containing the weights
-
getNeighbourNodesWeightsLists
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 studyorientation
- The orientation to take- Returns:
- A stream containing the weights
-
getEdgeTypes
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
Gets the different weights for the edges of the incident nodes.- Parameters:
node
- The node to study- Returns:
- A stream containing the weights
-
getAdjacentNodesTypesLists
Gets the different weights for the edges of the adjacent nodes.- Parameters:
node
- The node to study- Returns:
- A stream containing the weights
-
getNeighbourNodesTypesLists
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 studyorientation
- 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 interfaceGraph<U>
- Returns:
- true if it is, false if not.
-
removeEdge
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
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.
-