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 boolean
addEdge(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 double
getEdgeWeight(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 boolean
isWeighted()
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:
getIncidentNodesWeights
in 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:
getAdjacentNodesWeights
in 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:
getNeighbourNodesWeights
in 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:
getMutualNodesWeights
in 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:
getAdjacentMutualNodesWeights
in 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:
getIncidentMutualNodesWeights
in interfaceGraph<V>
- Parameters:
node
- The node.- Returns:
- a stream containing all the nodes in the neighbourhood.
-
getEdgeWeight
Description copied from interface:Graph
Obtains the weight of an edge in the graph- Specified by:
getEdgeWeight
in 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:Graph
Adds a new edge to the graph. If nodes do not exist, they are added. -
isWeighted
default boolean isWeighted()Description copied from interface:Graph
Indicates if the graph is weighted.- Specified by:
isWeighted
in interfaceGraph<V>
- Returns:
- true if it is, false if not.
-