Class FastDirectedWeightedMultiGraph<U>
java.lang.Object
es.uam.eps.ir.relison.graph.multigraph.fast.AbstractFastMultiGraph<U>
es.uam.eps.ir.relison.graph.multigraph.fast.FastDirectedWeightedMultiGraph<U>
- Type Parameters:
U- Type of the users
- All Implemented Interfaces:
DirectedGraph<U>,FastGraph<U>,Graph<U>,DirectedMultiGraph<U>,DirectedWeightedMultiGraph<U>,FastMultiGraph<U>,MultiGraph<U>,WeightedMultiGraph<U>,WeightedGraph<U>,ReducedIndex<U>,java.io.Serializable
public class FastDirectedWeightedMultiGraph<U> extends AbstractFastMultiGraph<U> implements DirectedWeightedMultiGraph<U>
Fast implementation of a directed weighted graph. This implementation does not allow to remove nodes/edges
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class es.uam.eps.ir.relison.graph.multigraph.fast.AbstractFastMultiGraph
edges, vertices -
Constructor Summary
Constructors Constructor Description FastDirectedWeightedMultiGraph()Constructor. -
Method Summary
Modifier and Type Method Description double[][]getAdjacencyMatrix(EdgeOrientation direction)Gets the adjacency matrix.java.util.stream.Stream<Weight<U,java.lang.Integer>>getAdjacentMutualNodesTypes(U node)Given a node, finds the types of the edges towards the nodes u such that the edge (node to u) and the edge (u to node) are in the graph.java.util.stream.Stream<Weight<U,java.lang.Double>>getAdjacentMutualNodesWeights(U node)Given a node, finds the weights of the edges towards the nodes u such that the edge (node to u) and the edge (u to node) are in the graph.java.util.stream.Stream<Weight<U,java.lang.Integer>>getIncidentMutualNodesTypes(U node)Given a node, finds the types of the edges from the nodes u such that the edge (node to u) and the edge (u to node) are in the graph.java.util.stream.Stream<Weight<U,java.lang.Double>>getIncidentMutualNodesWeights(U node)Given a node, finds the weights of the edges from the nodes u such that the edge (node to u) and the edge (u to node) are in the graph.intgetMutualEdgesCount(U node)Calculates the total number of adjacent edges of a node such that there is an incident reciprocal link towards the node.java.util.stream.Stream<U>getMutualNodes(U node)Given a node, finds all the nodes u such that the edges (node to u) and (u to node) are in the graph.java.util.stream.Stream<Weight<U,java.lang.Integer>>getMutualNodesTypes(U node)Given a node, find the types of edges from the nodes u such that the edge (node to u) and the edge (u to node) are in the graph.java.util.stream.Stream<Weight<U,java.lang.Double>>getMutualNodesWeights(U node)Given a node, finds the weights of the edges towards and from the nodes u such that the edge (node to u) and the edge (u to node) are in the graph.Methods inherited from class es.uam.eps.ir.relison.graph.multigraph.fast.AbstractFastMultiGraph
addEdge, addEdge, addNode, complement, containsEdge, containsEdge, containsVertex, getAdjacencyMatrixMap, getAdjacentEdgesCount, getAdjacentNodes, getAdjacentNodesTypes, getAdjacentNodesTypesLists, getAdjacentNodesWeights, getAdjacentNodesWeightsLists, getAllNodes, getAllNodesIds, getEdgeCount, getEdgeType, getEdgeTypes, getEdgeTypes, getEdgeWeight, getEdgeWeight, getEdgeWeights, getEdgeWeights, getIncidentEdgesCount, getIncidentNodes, getIncidentNodesTypes, getIncidentNodesTypesLists, getIncidentNodesWeights, getIncidentNodesWeightsLists, getIndex, getIsolatedNodeIds, getIsolatedNodes, getNeighborhood, getNeighborhoodTypes, getNeighborhoodWeights, getNeighbourEdgesCount, getNeighbourhood, getNeighbourhoodSize, getNeighbourhoodTypes, getNeighbourhoodTypesLists, getNeighbourhoodWeights, getNeighbourhoodWeightsLists, getNeighbourhoodWeightsLists, getNeighbourNodes, getNeighbourNodesTypes, getNeighbourNodesTypesLists, getNeighbourNodesWeights, getNeighbourNodesWeightsLists, getNodesIdsWithEdges, getNodesWithAdjacentNeighbors, getNodesWithIncidentNeighbors, getNodesWithMutualNeighbors, getNodesWithNeighbors, getNodesWithNeighbors, getNumEdges, getNumEdges, getVertexCount, hasAdjacentNeighbors, hasIncidentNeighbors, hasMutualNeighbors, hasNeighbors, idx2object, object2idx, removeEdge, removeEdge, removeEdges, removeNode, updateEdgeType, updateEdgeWeight, updateEdgeWeight, updateEdgeWeight, updateEdgeWeightMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface es.uam.eps.ir.relison.graph.DirectedGraph
degree, degree, getNeighbourEdgesCount, getNeighbourhood, getNeighbourhoodSize, getNeighbourhoodTypes, getNeighbourhoodWeights, getSinks, getSources, isDirected, mutualDegreeMethods inherited from interface es.uam.eps.ir.relison.graph.multigraph.DirectedMultiGraph
getNeighbourhoodTypesLists, getNeighbourhoodWeightsLists, inDegree, outDegreeMethods inherited from interface es.uam.eps.ir.relison.graph.Graph
addEdge, addEdge, addEdge, addEdge, addEdge, addEdge, addNode, complement, containsEdge, containsVertex, getAdjacencyMatrixMap, getAdjacentEdgesCount, getAdjacentNodes, getAdjacentNodesCount, getAdjacentNodesTypes, getAllNodes, getEdgeCount, getEdgeType, getEdgeWeight, getIncidentEdgesCount, getIncidentNodes, getIncidentNodesCount, getIncidentNodesTypes, getIsolatedNodes, getMutualNodesCount, getNeighbourNodes, getNeighbourNodesCount, getNeighbourNodesTypes, getNodesWithAdjacentNeighbors, getNodesWithIncidentNeighbors, getNodesWithMutualNeighbors, getNodesWithNeighbors, getNodesWithNeighbors, getVertexCount, hasAdjacentNeighbors, hasIncidentNeighbors, hasMutualNeighbors, hasNeighbors, hasNeighbors, isMutual, removeEdge, removeNode, updateEdgeType, updateEdgeWeightMethods inherited from interface es.uam.eps.ir.relison.graph.multigraph.MultiGraph
getAdjacentNodesTypesLists, getEdgeTypes, getEdgeWeights, getIncidentNodesTypesLists, getNeighbourNodesTypesLists, getNumEdges, isMultigraph, removeEdge, removeEdges, updateEdgeWeightMethods inherited from interface es.uam.eps.ir.relison.graph.WeightedGraph
getAdjacentNodesWeights, getIncidentNodesWeights, getNeighbourNodesWeights, isWeightedMethods inherited from interface es.uam.eps.ir.relison.graph.multigraph.WeightedMultiGraph
getAdjacentNodesWeightsLists, getIncidentNodesWeightsLists, getNeighbourNodesWeightsLists
-
Constructor Details
-
FastDirectedWeightedMultiGraph
public FastDirectedWeightedMultiGraph()Constructor.
-
-
Method Details
-
getAdjacencyMatrix
Description copied from interface:GraphGets the adjacency matrix.- Specified by:
getAdjacencyMatrixin interfaceGraph<U>- Parameters:
direction- The direction of the edges.- Returns:
- the adjacency matrix.
-
getMutualNodes
Description copied from interface:GraphGiven a node, finds all the nodes u such that the edges (node to u) and (u to node) are in the graph.- Specified by:
getMutualNodesin interfaceGraph<U>- Parameters:
node- The node.- Returns:
- A stream containing all the nodes which share reciprocal links.
-
getMutualEdgesCount
Description copied from interface:GraphCalculates the total number of adjacent edges of a node such that there is an incident reciprocal link towards the node.- Specified by:
getMutualEdgesCountin interfaceGraph<U>- Parameters:
node- The node.- Returns:
- the number of reciprocal links starting from the node.
-
getAdjacentMutualNodesWeights
Description copied from interface:GraphGiven a node, finds the weights of the edges towards the nodes u such that the edge (node to u) and the edge (u to node) are in the graph.- Specified by:
getAdjacentMutualNodesWeightsin interfaceGraph<U>- Parameters:
node- The node.- Returns:
- A stream containing all the nodes in the neighbourhood and weights.
-
getIncidentMutualNodesWeights
Description copied from interface:GraphGiven a node, finds the weights of the edges from the nodes u such that the edge (node to u) and the edge (u to node) are in the graph.- Specified by:
getIncidentMutualNodesWeightsin interfaceGraph<U>- Parameters:
node- The node.- Returns:
- A stream containing all the nodes in the neighbourhood and weights.
-
getMutualNodesWeights
Description copied from interface:GraphGiven a node, finds the weights of the edges towards and from the nodes u such that the edge (node to u) and the edge (u to node) are in the graph. It finds the average value of the outgoing and incoming links.- Specified by:
getMutualNodesWeightsin interfaceGraph<U>- Parameters:
node- The node.- Returns:
- A stream containing all the nodes in the neighbourhood and weights.
-
getMutualNodesTypes
Description copied from interface:GraphGiven a node, find the types of edges from the nodes u such that the edge (node to u) and the edge (u to node) are in the graph.- Specified by:
getMutualNodesTypesin interfaceGraph<U>- Parameters:
node- the node.- Returns:
- a stream containing all the nodes in the neighbourhood and types.
-
getAdjacentMutualNodesTypes
Description copied from interface:GraphGiven a node, finds the types of the edges towards the nodes u such that the edge (node to u) and the edge (u to node) are in the graph.- Specified by:
getAdjacentMutualNodesTypesin interfaceGraph<U>- Parameters:
node- The node.- Returns:
- A stream containing all the nodes in the neighbourhood and types.
-
getIncidentMutualNodesTypes
Description copied from interface:GraphGiven a node, finds the types of the edges from the nodes u such that the edge (node to u) and the edge (u to node) are in the graph.- Specified by:
getIncidentMutualNodesTypesin interfaceGraph<U>- Parameters:
node- The node.- Returns:
- A stream containing all the nodes in the neighbourhood and types.
-