Package es.uam.eps.ir.relison.graph
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 Summary
Modifier and Type Method Description default booleanaddEdge(V nodeA, V nodeB, double weight, int type)Adds a new edge to the graph.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.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 doublegetEdgeWeight(V incident, V adjacent)Obtains the weight of an edge in the graphdefault 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.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>>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.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.default booleanisWeighted()Indicates if the graph is weighted.Methods inherited from interface es.uam.eps.ir.relison.graph.Graph
addEdge, addEdge, addEdge, addEdge, addEdge, addNode, complement, containsEdge, containsVertex, degree, degree, getAdjacencyMatrix, getAdjacencyMatrixMap, getAdjacentEdgesCount, getAdjacentMutualNodesTypes, getAdjacentNodes, getAdjacentNodesCount, getAdjacentNodesTypes, getAllNodes, getEdgeCount, getEdgeType, getIncidentEdgesCount, getIncidentMutualNodesTypes, getIncidentNodes, getIncidentNodesCount, getIncidentNodesTypes, getIsolatedNodes, getMutualEdgesCount, getMutualNodes, getMutualNodesCount, getMutualNodesTypes, getNeighbourEdgesCount, getNeighbourhood, getNeighbourhoodSize, getNeighbourhoodTypes, getNeighbourhoodWeights, getNeighbourNodes, getNeighbourNodesCount, getNeighbourNodesTypes, getNodesWithAdjacentNeighbors, getNodesWithIncidentNeighbors, getNodesWithMutualNeighbors, getNodesWithNeighbors, getNodesWithNeighbors, getVertexCount, hasAdjacentNeighbors, hasIncidentNeighbors, hasMutualNeighbors, hasNeighbors, hasNeighbors, inDegree, isDirected, isMultigraph, isMutual, mutualDegree, outDegree, removeEdge, removeNode, updateEdgeType, updateEdgeWeight
-
Method Details
-
getIncidentNodesWeights
Given a node, finds all the nodes u such that the edge (u to node) is in the graph.- Specified by:
getIncidentNodesWeightsin interfaceGraph<V>- Parameters:
node- The node.- Returns:
- a stream of the incident nodes.
-
getAdjacentNodesWeights
Given a node, finds all the nodes u such that the edge (node to u) is in the graph.- Specified by:
getAdjacentNodesWeightsin interfaceGraph<V>- Parameters:
node- The node.- Returns:
- a stream containing the adjacent nodes.
-
getNeighbourNodesWeights
Given a node, finds all the nodes u so that either (node to u) or (u to node) are in the graph.- Specified by:
getNeighbourNodesWeightsin interfaceGraph<V>- Parameters:
node- The node.- Returns:
- a stream containing all the nodes in the neighbourhood.
-
getMutualNodesWeights
Given a node, finds all the nodes u so that either (node to u) or (u to node) are in the graph.- Specified by:
getMutualNodesWeightsin interfaceGraph<V>- Parameters:
node- The node.- Returns:
- a stream containing all the nodes in the neighbourhood.
-
getAdjacentMutualNodesWeights
Given a node, finds all the nodes u so that either (node to u) or (u to node) are in the graph.- Specified by:
getAdjacentMutualNodesWeightsin interfaceGraph<V>- Parameters:
node- The node.- Returns:
- A stream containing all the nodes in the neighbourhood.
-
getIncidentMutualNodesWeights
Given a node, finds all the nodes u so that either (node to u) or (u to node) are in the graph.- Specified by:
getIncidentMutualNodesWeightsin interfaceGraph<V>- Parameters:
node- The node.- Returns:
- a stream containing all the nodes in the neighbourhood.
-
getEdgeWeight
Description copied from interface:GraphObtains the weight of an edge in the graph- Specified by:
getEdgeWeightin interfaceGraph<V>- Parameters:
incident- The incident node.adjacent- The adjacent node.- Returns:
- The corresponding weight. If the edge does not exist, NaN
-
addEdge
Description copied from interface:GraphAdds a new edge to the graph. If nodes do not exist, they are added. -
isWeighted
default boolean isWeighted()Description copied from interface:GraphIndicates if the graph is weighted.- Specified by:
isWeightedin interfaceGraph<V>- Returns:
- true if it is, false if not.
-