Package es.uam.eps.ir.relison.graph
Interface DirectedGraph<V>
- Type Parameters:
V- Type of vertices.
- All Superinterfaces:
Graph<V>,java.io.Serializable
- All Known Subinterfaces:
DirectedMultiGraph<U>,DirectedUnweightedGraph<V>,DirectedUnweightedMultiGraph<V>,DirectedWeightedGraph<V>,DirectedWeightedMultiGraph<U>,Tree<U>,UnweightedTree<U>,WeightedTree<U>
- All Known Implementing Classes:
DirectedJungGraph,DirectedUnweightedComplementaryGraph,DirectedWeightedComplementaryGraph,FastDirectedUnweightedGraph,FastDirectedUnweightedMultiGraph,FastDirectedWeightedGraph,FastDirectedWeightedMultiGraph,FastTree,FastUnweightedTree,FastWeightedTree
public interface DirectedGraph<V> extends Graph<V>
Interface for directed graphs.
-
Method Summary
Modifier and Type Method Description default intdegree(V node)Calculates the degree of a node.default intdegree(V node, EdgeOrientation orientation)Obtains the degree of a node, depending on the neighborhood selection.default intgetNeighbourEdgesCount(V node)Calculates the total number of edges which reach a node or start from it (not necessarily equal to the degree).default java.util.stream.Stream<V>getNeighbourhood(V node, EdgeOrientation direction)Gets all the nodes in the neighbourhood of a node given by a direction.default intgetNeighbourhoodSize(V node, EdgeOrientation direction)Gets all the nodes in the neighbourhood of a node given by a direction.default java.util.stream.Stream<Weight<V,java.lang.Integer>>getNeighbourhoodTypes(V node, EdgeOrientation direction)Gets all the types of the edges in the neighbourhood of a node given by a direction.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<V>getSinks()Gets all the nodes which just have incoming links.default java.util.stream.Stream<V>getSources()Gets all the nodes which just have outgoing links.default intinDegree(V node)Obtains the in-degree of a node.default booleanisDirected()Indicates if the graph is directed.default intmutualDegree(V node)Obtains the mutual degree of a node.default intoutDegree(V node)Obtains the out-degree of a node.Methods inherited from interface es.uam.eps.ir.relison.graph.Graph
addEdge, addEdge, addEdge, addEdge, addEdge, addEdge, addNode, complement, containsEdge, containsVertex, 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, getNeighbourNodes, getNeighbourNodesCount, getNeighbourNodesTypes, getNeighbourNodesWeights, getNodesWithAdjacentNeighbors, getNodesWithIncidentNeighbors, getNodesWithMutualNeighbors, getNodesWithNeighbors, getNodesWithNeighbors, getVertexCount, hasAdjacentNeighbors, hasIncidentNeighbors, hasMutualNeighbors, hasNeighbors, hasNeighbors, isMultigraph, isMutual, isWeighted, removeEdge, removeNode, updateEdgeType, updateEdgeWeight
-
Method Details
-
getNeighbourhood
Description copied from interface:GraphGets all the nodes in the neighbourhood of a node given by a direction.- Specified by:
getNeighbourhoodin interfaceGraph<V>- Parameters:
node- The node.direction- The direction of the links.- Returns:
- A stream containing the corresponding neighbourhood.
-
getNeighbourhoodSize
Description copied from interface:GraphGets all the nodes in the neighbourhood of a node given by a direction.- Specified by:
getNeighbourhoodSizein interfaceGraph<V>- Parameters:
node- The node.direction- The direction of the links.- Returns:
- A stream containing the corresponding neighbourhood.
-
getNeighbourhoodWeights
default java.util.stream.Stream<Weight<V,java.lang.Double>> getNeighbourhoodWeights(V node, EdgeOrientation direction)Description copied from interface:GraphGets 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:
getNeighbourhoodWeightsin interfaceGraph<V>- Parameters:
node- The node.direction- The direction of the links- Returns:
- A stream containing the corresponding neighbourhood and weights.
-
getNeighbourhoodTypes
default java.util.stream.Stream<Weight<V,java.lang.Integer>> getNeighbourhoodTypes(V node, EdgeOrientation direction)Description copied from interface:GraphGets all the types of the edges in the neighbourhood of a node given by a direction. In the mutual case, it does not work (types are categorical values), so an empty stream is returned.- Specified by:
getNeighbourhoodTypesin interfaceGraph<V>- Parameters:
node- The node.direction- The direction of the links.- Returns:
- A stream containing the corresponding neighbourhood.
-
degree
Description copied from interface:GraphCalculates the degree of a node. -
inDegree
Obtains the in-degree of a node. -
outDegree
Obtains the out-degree of a node. -
mutualDegree
Obtains the mutual degree of a node.- Specified by:
mutualDegreein interfaceGraph<V>- Parameters:
node- the node.- Returns:
- the mutual degree of the node
-
degree
Description copied from interface:GraphObtains the degree of a node, depending on the neighborhood selection. -
getNeighbourEdgesCount
Description copied from interface:GraphCalculates the total number of edges which reach a node or start from it (not necessarily equal to the degree).- Specified by:
getNeighbourEdgesCountin interfaceGraph<V>- Parameters:
node- The node.- Returns:
- the degree of the node if it is contained in the graph, -1 if not.
-
isDirected
default boolean isDirected()Description copied from interface:GraphIndicates if the graph is directed.- Specified by:
isDirectedin interfaceGraph<V>- Returns:
- true if it is, false if not.
-
getSources
Gets all the nodes which just have outgoing links.- Returns:
- the set of nodes with just outgoing links.
-
getSinks
Gets all the nodes which just have incoming links.- Returns:
- the set of nodes with just incoming links.
-