Package es.uam.eps.ir.relison.graph
Interface UndirectedWeightedGraph<V>
- Type Parameters:
V
- Type of vertices.
- All Superinterfaces:
Graph<V>
,java.io.Serializable
,UndirectedGraph<V>
,WeightedGraph<V>
- All Known Implementing Classes:
FastUndirectedWeightedGraph
public interface UndirectedWeightedGraph<V> extends WeightedGraph<V>, UndirectedGraph<V>
Interface for undirected weighted graphs.
-
Method Summary
Modifier and Type Method Description 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.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.default java.util.stream.Stream<Weight<V,java.lang.Double>>
getNeighbourhoodWeights(V node, EdgeOrientation direction)
Gets all the weights of the edges in the neighbourhood of a node given by a direction.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.Methods inherited from interface es.uam.eps.ir.relison.graph.Graph
addEdge, addEdge, addEdge, addEdge, addEdge, addEdge, addNode, complement, containsEdge, containsVertex, getAdjacencyMatrix, getAdjacencyMatrixMap, getAdjacentMutualNodesWeights, getAdjacentNodesCount, getAllNodes, getEdgeCount, getEdgeType, getEdgeWeight, getIncidentMutualNodesWeights, getIncidentNodesCount, getIsolatedNodes, getMutualNodesWeights, getNeighbourNodes, getNeighbourNodesCount, getNeighbourNodesTypes, getNodesWithAdjacentNeighbors, getNodesWithIncidentNeighbors, getNodesWithMutualNeighbors, getNodesWithNeighbors, getNodesWithNeighbors, getVertexCount, hasAdjacentNeighbors, hasIncidentNeighbors, hasMutualNeighbors, hasNeighbors, hasNeighbors, isMultigraph, removeEdge, removeNode, updateEdgeType, updateEdgeWeight
Methods inherited from interface es.uam.eps.ir.relison.graph.UndirectedGraph
degree, degree, getAdjacentEdgesCount, getAdjacentMutualNodesTypes, getAdjacentNodes, getAdjacentNodesTypes, getIncidentEdgesCount, getIncidentMutualNodesTypes, getIncidentNodes, getIncidentNodesTypes, getMutualEdgesCount, getMutualNodes, getMutualNodesCount, getMutualNodesTypes, getNeighbourEdgesCount, getNeighbourhood, getNeighbourhoodSize, getNeighbourhoodTypes, inDegree, isDirected, isMutual, mutualDegree, outDegree
-
Method Details
-
getIncidentNodesWeights
Description copied from interface:WeightedGraph
Given a node, finds all the nodes u such that the edge (u to node) is in the graph.- Specified by:
getIncidentNodesWeights
in interfaceGraph<V>
- Specified by:
getIncidentNodesWeights
in interfaceUndirectedGraph<V>
- Specified by:
getIncidentNodesWeights
in interfaceWeightedGraph<V>
- Parameters:
node
- The node.- Returns:
- A stream of the incident nodes.
-
getAdjacentNodesWeights
Description copied from interface:WeightedGraph
Given a node, finds all the nodes u such that the edge (node to u) is in the graph.- Specified by:
getAdjacentNodesWeights
in interfaceGraph<V>
- Specified by:
getAdjacentNodesWeights
in interfaceUndirectedGraph<V>
- Specified by:
getAdjacentNodesWeights
in interfaceWeightedGraph<V>
- Parameters:
node
- The node.- Returns:
- A stream containing the adjacent nodes.
-
getNeighbourNodesWeights
Description copied from interface:WeightedGraph
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 interfaceGraph<V>
- Specified by:
getNeighbourNodesWeights
in interfaceWeightedGraph<V>
- Parameters:
node
- The node.- Returns:
- A stream containing all the nodes in the neighbourhood.
-
getNeighbourhoodWeights
default java.util.stream.Stream<Weight<V,java.lang.Double>> getNeighbourhoodWeights(V node, EdgeOrientation direction)Description copied from interface:Graph
Gets all the weights of the edges in the neighbourhood of a node given by a direction. In the mutual case, just returns the average of the edge weights.- Specified by:
getNeighbourhoodWeights
in interfaceGraph<V>
- Specified by:
getNeighbourhoodWeights
in interfaceUndirectedGraph<V>
- Parameters:
node
- The node.direction
- The direction of the links- Returns:
- A stream containing the corresponding neighbourhood and weights.
-