Package es.uam.eps.ir.relison.graph.fast
Interface FastGraph<U>
- Type Parameters:
U
- type of the users.
- All Superinterfaces:
Graph<U>
,ReducedIndex<U>
,java.io.Serializable
- All Known Subinterfaces:
FastMultiGraph<U>
- All Known Implementing Classes:
AbstractFastGraph
,AbstractFastMultiGraph
,FastDirectedUnweightedGraph
,FastDirectedUnweightedMultiGraph
,FastDirectedWeightedGraph
,FastDirectedWeightedMultiGraph
,FastTree
,FastUndirectedUnweightedGraph
,FastUndirectedUnweightedMultiGraph
,FastUndirectedWeightedGraph
,FastUndirectedWeightedMultiGraph
,FastUnweightedTree
,FastWeightedTree
public interface FastGraph<U> extends Graph<U>, ReducedIndex<U>
Interface for fast implementations of graphs.
-
Method Summary
Modifier and Type Method Description boolean
addEdge(int nodeA, int nodeB, double weight, int type)
Uncontrolled edge addition method, using ids.boolean
containsEdge(int uidx, int vidx)
Checks whether the network contains an edge or not.java.util.stream.IntStream
getAllNodesIds()
Obtains the identifiers of all the nodes in the network.double
getEdgeWeight(int uidx, int vidx)
Obtains the weight of an edge, given the identifiers of the involved nodes.Index<U>
getIndex()
Obtains the index for the vertices.java.util.stream.IntStream
getIsolatedNodeIds()
Obtains the set of isolated nodes in the graph.java.util.stream.Stream<java.lang.Integer>
getNeighborhood(int uidx, EdgeOrientation orientation)
Obtains the neighborhood of a node, given its identifier.java.util.stream.Stream<EdgeType>
getNeighborhoodTypes(int uidx, EdgeOrientation orientation)
Obtains the neighborhood of a node and the type of the edges to each other, given its identifier.java.util.stream.Stream<es.uam.eps.ir.ranksys.fast.preference.IdxPref>
getNeighborhoodWeights(int uidx, EdgeOrientation orientation)
Obtains the neighborhood of a node and the weight of the edges to each other, given its identifier.java.util.stream.IntStream
getNodesIdsWithEdges(EdgeOrientation direction)
Obtains the identifiers of the nodes which have edges.boolean
updateEdgeWeight(int nodeA, int nodeB, double weight)
Uncontrolled edge update method, using ids.Methods inherited from interface es.uam.eps.ir.relison.graph.Graph
addEdge, addEdge, addEdge, addEdge, addEdge, addEdge, addNode, complement, containsEdge, containsVertex, degree, degree, 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, getNeighbourEdgesCount, getNeighbourhood, getNeighbourhoodSize, getNeighbourhoodTypes, getNeighbourhoodWeights, getNeighbourNodes, getNeighbourNodesCount, getNeighbourNodesTypes, getNeighbourNodesWeights, getNodesWithAdjacentNeighbors, getNodesWithIncidentNeighbors, getNodesWithMutualNeighbors, getNodesWithNeighbors, getNodesWithNeighbors, getVertexCount, hasAdjacentNeighbors, hasIncidentNeighbors, hasMutualNeighbors, hasNeighbors, hasNeighbors, inDegree, isDirected, isMultigraph, isMutual, isWeighted, mutualDegree, outDegree, removeEdge, removeNode, updateEdgeType, updateEdgeWeight
-
Method Details
-
getAllNodesIds
java.util.stream.IntStream getAllNodesIds()Obtains the identifiers of all the nodes in the network.- Returns:
- an stream containing the vertex identifiers.
-
getNodesIdsWithEdges
Obtains the identifiers of the nodes which have edges.- Parameters:
direction
- the orientation selection.- Returns:
- a stream containing the corresponding nodes.
-
getIsolatedNodeIds
java.util.stream.IntStream getIsolatedNodeIds()Obtains the set of isolated nodes in the graph.- Returns:
- a stream containing the isolated nodes.
-
containsEdge
boolean containsEdge(int uidx, int vidx)Checks whether the network contains an edge or not.- Parameters:
uidx
- the identifier of the first vertexvidx
- the identifier of the second vertex- Returns:
- true if the edge exists, false otherwise.
-
addEdge
boolean addEdge(int nodeA, int nodeB, double weight, int type)Uncontrolled edge addition method, using ids.- Parameters:
nodeA
- Identifier of the first node.nodeB
- Identifier of the second node.weight
- Weight of the link.type
- Type of the link.- Returns:
- true if everything went ok, false otherwise.
-
updateEdgeWeight
boolean updateEdgeWeight(int nodeA, int nodeB, double weight)Uncontrolled edge update method, using ids.- Parameters:
nodeA
- Identifier of the first node.nodeB
- Identifier of the second node.weight
- Weight of the link.- Returns:
- true if everything went ok, false otherwise.
-
getEdgeWeight
double getEdgeWeight(int uidx, int vidx)Obtains the weight of an edge, given the identifiers of the involved nodes.- Parameters:
uidx
- identifier of the first user.vidx
- identifier of the second user.- Returns:
- the weight if it exists, an error value otherwise.
-
getNeighborhood
Obtains the neighborhood of a node, given its identifier.- Parameters:
uidx
- the identifier of the node.orientation
- the orientation of the neighborhood to retrieve.- Returns:
- an stream containing the neighbors of the node.
-
getNeighborhoodWeights
java.util.stream.Stream<es.uam.eps.ir.ranksys.fast.preference.IdxPref> getNeighborhoodWeights(int uidx, EdgeOrientation orientation)Obtains the neighborhood of a node and the weight of the edges to each other, given its identifier.- Parameters:
uidx
- the identifier of the node.orientation
- the orientation of the neighborhood to retrieve.- Returns:
- an stream containing the weights of neighbors of the node.
-
getNeighborhoodTypes
Obtains the neighborhood of a node and the type of the edges to each other, given its identifier.- Parameters:
uidx
- the identifier of the node.orientation
- the orientation of the neighborhood to retrieve.- Returns:
- an stream containing the edge types of the neighbors of the node.
-
getIndex
Obtains the index for the vertices.- Returns:
- the index for the vertices.
-