Class Analyst
- java.lang.Object
-
- oracle.pgx.api.internal.ApiObject
-
- oracle.pgx.api.Destroyable
-
- oracle.pgx.api.Analyst
-
- All Implemented Interfaces:
java.lang.AutoCloseable
- Direct Known Subclasses:
NamedArgumentAnalyst
public class Analyst extends Destroyable
The Analyst gives access to all built-in algorithms of PGX. Unlike other classes inside this package, the Analyst is not stateless. It creates session-bound transient data to hold the result of algorithms and keeps track of them. OnceDestroyable.destroy()
is invoked, all transient data returned by the Analyst gets freed and cannot be used anymore.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <V> EdgeProperty<java.lang.Double>
adamicAdarCounting(PgxGraph graph)
The adamic-adar index compares the amount of neighbors shared between vertices, this measure can be used with communities.<V> EdgeProperty<java.lang.Double>
adamicAdarCounting(PgxGraph graph, EdgeProperty<java.lang.Double> aa)
The adamic-adar index compares the amount of neighbors shared between vertices, this measure can be used with communities.PgxFuture<EdgeProperty<java.lang.Double>>
adamicAdarCountingAsync(PgxGraph graph)
The adamic-adar index compares the amount of neighbors shared between vertices, this measure can be used with communities.PgxFuture<EdgeProperty<java.lang.Double>>
adamicAdarCountingAsync(PgxGraph graph, EdgeProperty<java.lang.Double> aa)
The adamic-adar index compares the amount of neighbors shared between vertices, this measure can be used with communities.<ID> org.apache.commons.lang3.tuple.Triple<VertexSet<ID>,EdgeSet,PgxMap<PgxVertex<ID>,java.lang.Integer>>
allReachableVerticesEdges(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, int k)
Finds all the vertices and edges on a path between the src and target of length smaller or equal to k.<ID> PgxFuture<org.apache.commons.lang3.tuple.Triple<VertexSet<ID>,EdgeSet,PgxMap<PgxVertex<ID>,java.lang.Integer>>>
allReachableVerticesEdgesAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, int k)
Finds all the vertices and edges on a path between the src and target of length smaller or equal to k.<ID> org.apache.commons.lang3.tuple.Triple<VertexSet<ID>,EdgeSet,PgxMap<PgxVertex<ID>,java.lang.Integer>>
allReachableVerticesEdgesFiltered(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, int k, EdgeFilter filter)
Finds all the vertices and edges on a path between the src and target of length smaller or equal to k.<ID> PgxFuture<org.apache.commons.lang3.tuple.Triple<VertexSet<ID>,EdgeSet,PgxMap<PgxVertex<ID>,java.lang.Integer>>>
allReachableVerticesEdgesFilteredAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, int k, EdgeFilter filter)
Finds all the vertices and edges on a path between the src and target of length smaller or equal to k.<ID> VertexProperty<ID,java.lang.Double>
approximateVertexBetweennessCentrality(PgxGraph graph, int k)
Faster, but less accurate than betweenness centrality, it identifies important vertices for the flow of information<ID> VertexProperty<ID,java.lang.Double>
approximateVertexBetweennessCentrality(PgxGraph graph, int k, VertexProperty<ID,java.lang.Double> bc)
Faster, but less accurate than betweenness centrality, it identifies important vertices for the flow of information<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
approximateVertexBetweennessCentralityAsync(PgxGraph graph, int k)
Faster, but less accurate than betweenness centrality, it identifies important vertices for the flow of information<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
approximateVertexBetweennessCentralityAsync(PgxGraph graph, int k, VertexProperty<ID,java.lang.Double> bc)
Faster, but less accurate than betweenness centrality, it identifies important vertices for the flow of information<ID> VertexProperty<ID,java.lang.Double>
approximateVertexBetweennessCentralityFromSeeds(PgxGraph graph, PgxVertex<ID>... seeds)
Faster, but less accurate than betweenness centrality, it identifies important vertices for the flow of information<ID> VertexProperty<ID,java.lang.Double>
approximateVertexBetweennessCentralityFromSeeds(PgxGraph graph, VertexProperty<ID,java.lang.Double> bc, PgxVertex<ID>... seeds)
Faster, but less accurate than betweenness centrality, it identifies important vertices for the flow of information<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
approximateVertexBetweennessCentralityFromSeedsAsync(PgxGraph graph, PgxVertex<ID>... seeds)
Faster, but less accurate than betweenness centrality, it identifies important vertices for the flow of information<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
approximateVertexBetweennessCentralityFromSeedsAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> bc, PgxVertex<ID>... seeds)
Faster, but less accurate than betweenness centrality, it identifies important vertices for the flow of information<ID> VertexProperty<ID,java.lang.Double>
articleRank(PgxGraph graph)
ArticleRank computes ranking scores based on the edges in a graph.<ID> VertexProperty<ID,java.lang.Double>
articleRank(PgxGraph graph, boolean norm)
ArticleRank computes ranking scores based on the edges in a graph.<ID> VertexProperty<ID,java.lang.Double>
articleRank(PgxGraph graph, boolean norm, VertexProperty<ID,java.lang.Double> rank)
ArticleRank computes ranking scores based on the edges in a graph.<ID> VertexProperty<ID,java.lang.Double>
articleRank(PgxGraph graph, double e, double d, int max)
ArticleRank computes ranking scores based on the edges in a graph.<ID> VertexProperty<ID,java.lang.Double>
articleRank(PgxGraph graph, double e, double d, int max, boolean norm)
ArticleRank computes ranking scores based on the edges in a graph.<ID> VertexProperty<ID,java.lang.Double>
articleRank(PgxGraph graph, double e, double d, int max, boolean norm, VertexProperty<ID,java.lang.Double> rank)
ArticleRank computes ranking scores based on the edges in a graph.<ID> VertexProperty<ID,java.lang.Double>
articleRank(PgxGraph graph, double e, double d, int max, VertexProperty<ID,java.lang.Double> rank)
ArticleRank computes ranking scores based on the edges in a graph.<ID> VertexProperty<ID,java.lang.Double>
articleRank(PgxGraph graph, VertexProperty<ID,java.lang.Double> rank)
ArticleRank computes ranking scores based on the edges in a graph.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
articleRankAsync(PgxGraph graph)
ArticleRank computes ranking scores based on the edges in a graph.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
articleRankAsync(PgxGraph graph, boolean norm)
ArticleRank computes ranking scores based on the edges in a graph.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
articleRankAsync(PgxGraph graph, boolean norm, VertexProperty<ID,java.lang.Double> rank)
ArticleRank computes ranking scores based on the edges in a graph.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
articleRankAsync(PgxGraph graph, double e, double d, int max)
ArticleRank computes ranking scores based on the edges in a graph.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
articleRankAsync(PgxGraph graph, double e, double d, int max, boolean norm)
ArticleRank computes ranking scores based on the edges in a graph.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
articleRankAsync(PgxGraph graph, double e, double d, int max, boolean norm, VertexProperty<ID,java.lang.Double> rank)
ArticleRank computes ranking scores based on the edges in a graph.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
articleRankAsync(PgxGraph graph, double e, double d, int max, VertexProperty<ID,java.lang.Double> rank)
ArticleRank computes ranking scores based on the edges in a graph.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
articleRankAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> rank)
ArticleRank computes ranking scores based on the edges in a graph.<ID> VertexProperty<ID,java.lang.Boolean>
bipartiteCheck(PgxGraph graph, VertexProperty<ID,java.lang.Boolean> isLeft)
Bipartite check verifies whether are graph is a bipartite graph.<ID> PgxFuture<VertexProperty<ID,java.lang.Boolean>>
bipartiteCheckAsync(PgxGraph graph, VertexProperty<ID,java.lang.Boolean> isLeft)
Bipartite check verifies whether are graph is a bipartite graph.CategoricalPropertyConfigBuilder
categoricalPropertyConfigBuilder(java.lang.String featureName)
Return a CategoricalPropertyConfigBuilder used to create a CategoricalPropertyConfig<ID> VertexSet<ID>
center(PgxGraph graph)
Periphery/center gives an overview of the extreme distances and the corresponding vertices in a graph<ID> VertexSet<ID>
center(PgxGraph graph, VertexSet<ID> center)
Periphery/center gives an overview of the extreme distances and the corresponding vertices in a graph<ID> PgxFuture<VertexSet<ID>>
centerAsync(PgxGraph graph)
Periphery/center gives an overview of the extreme distances and the corresponding vertices in a graph<ID> PgxFuture<VertexSet<ID>>
centerAsync(PgxGraph graph, VertexSet<ID> center)
Periphery/center gives an overview of the extreme distances and the corresponding vertices in a graph<ID> VertexProperty<ID,java.lang.Double>
closenessCentralityDoubleLength(PgxGraph graph, EdgeProperty<java.lang.Double> cost)
Closeness centrality measures the centrality of the vertices based on weighted distances, allowing to find well-connected vertices<ID> VertexProperty<ID,java.lang.Double>
closenessCentralityDoubleLength(PgxGraph graph, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,java.lang.Double> cc)
Closeness centrality measures the centrality of the vertices based on weighted distances, allowing to find well-connected vertices<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
closenessCentralityDoubleLengthAsync(PgxGraph graph, EdgeProperty<java.lang.Double> cost)
Closeness centrality measures the centrality of the vertices based on weighted distances, allowing to find well-connected vertices<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
closenessCentralityDoubleLengthAsync(PgxGraph graph, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,java.lang.Double> cc)
Closeness centrality measures the centrality of the vertices based on weighted distances, allowing to find well-connected vertices<ID> VertexProperty<ID,java.lang.Double>
closenessCentralityUnitLength(PgxGraph graph)
Closeness centrality measures the centrality of the vertices based on distances, allowing to find well-connected vertices<ID> VertexProperty<ID,java.lang.Double>
closenessCentralityUnitLength(PgxGraph graph, VertexProperty<ID,java.lang.Double> cc)
Closeness centrality measures the centrality of the vertices based on distances, allowing to find well-connected vertices<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
closenessCentralityUnitLengthAsync(PgxGraph graph)
Closeness centrality measures the centrality of the vertices based on distances, allowing to find well-connected vertices<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
closenessCentralityUnitLengthAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> cc)
Closeness centrality measures the centrality of the vertices based on distances, allowing to find well-connected vertices<ID> Partition<ID>
communitiesConductanceMinimization(PgxGraph graph)
Soman and Narang can find communities in a graph taking weighted edges into account<ID> Partition<ID>
communitiesConductanceMinimization(PgxGraph graph, int maxIterations)
Soman and Narang can find communities in a graph taking weighted edges into account<ID> Partition<ID>
communitiesConductanceMinimization(PgxGraph graph, int maxIterations, VertexProperty<ID,java.lang.Long> partitionDistribution)
Soman and Narang can find communities in a graph taking weighted edges into account<ID> Partition<ID>
communitiesConductanceMinimization(PgxGraph graph, VertexProperty<ID,java.lang.Long> partitionDistribution)
Soman and Narang can find communities in a graph taking weighted edges into account<ID> PgxFuture<Partition<ID>>
communitiesConductanceMinimizationAsync(PgxGraph graph)
Soman and Narang can find communities in a graph taking weighted edges into account<ID> PgxFuture<Partition<ID>>
communitiesConductanceMinimizationAsync(PgxGraph graph, int max)
Soman and Narang can find communities in a graph taking weighted edges into account<ID> PgxFuture<Partition<ID>>
communitiesConductanceMinimizationAsync(PgxGraph graph, int maxIterations, VertexProperty<ID,java.lang.Long> partitionDistribution)
Soman and Narang can find communities in a graph taking weighted edges into account<ID> PgxFuture<Partition<ID>>
communitiesConductanceMinimizationAsync(PgxGraph graph, VertexProperty<ID,java.lang.Long> partitionDistribution)
Soman and Narang can find communities in a graph taking weighted edges into account<ID> Partition<ID>
communitiesInfomap(PgxGraph graph, VertexProperty<ID,java.lang.Double> rank, EdgeProperty<java.lang.Double> weight)
Infomap can find high quality communities in a graph.<ID> Partition<ID>
communitiesInfomap(PgxGraph graph, VertexProperty<ID,java.lang.Double> rank, EdgeProperty<java.lang.Double> weight, double tau, double tol, int maxIter)
Infomap can find high quality communities in a graph.<ID> Partition<ID>
communitiesInfomap(PgxGraph graph, VertexProperty<ID,java.lang.Double> rank, EdgeProperty<java.lang.Double> weight, double tau, double tol, int maxIter, VertexProperty<ID,java.lang.Long> module)
Infomap can find high quality communities in a graph.<ID> Partition<ID>
communitiesInfomap(PgxGraph graph, VertexProperty<ID,java.lang.Double> rank, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Long> module)
Infomap can find high quality communities in a graph.<ID> PgxFuture<Partition<ID>>
communitiesInfomapAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> rank, EdgeProperty<java.lang.Double> weight)
Infomap can find high quality communities in a graph.<ID> PgxFuture<Partition<ID>>
communitiesInfomapAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> rank, EdgeProperty<java.lang.Double> weight, double tau, double tol, int maxIter)
Infomap can find high quality communities in a graph.<ID> PgxFuture<Partition<ID>>
communitiesInfomapAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> rank, EdgeProperty<java.lang.Double> weight, double tau, double tol, int maxIter, VertexProperty<ID,java.lang.Long> module)
Infomap can find high quality communities in a graph.<ID> PgxFuture<Partition<ID>>
communitiesInfomapAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> rank, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Long> module)
Infomap can find high quality communities in a graph.<ID> Partition<ID>
communitiesLabelPropagation(PgxGraph graph)
Label propagation can find communities in a graph relatively fast<ID> Partition<ID>
communitiesLabelPropagation(PgxGraph graph, int maxIterations)
Label propagation can find communities in a graph relatively fast<ID> Partition<ID>
communitiesLabelPropagation(PgxGraph graph, int maxIterations, VertexProperty<ID,java.lang.Long> partitionDistribution)
Label propagation can find communities in a graph relatively fast<ID> Partition<ID>
communitiesLabelPropagation(PgxGraph graph, VertexProperty<ID,java.lang.Long> partitonDistribution)
Label propagation can find communities in a graph relatively fast<ID> PgxFuture<Partition<ID>>
communitiesLabelPropagationAsync(PgxGraph graph)
Label propagation can find communities in a graph relatively fast<ID> PgxFuture<Partition<ID>>
communitiesLabelPropagationAsync(PgxGraph graph, int maxIterations)
Label propagation can find communities in a graph relatively fast<ID> PgxFuture<Partition<ID>>
communitiesLabelPropagationAsync(PgxGraph graph, int maxIterations, VertexProperty<ID,java.lang.Long> partitionDistribution)
Label propagation can find communities in a graph relatively fast<ID> PgxFuture<Partition<ID>>
communitiesLabelPropagationAsync(PgxGraph graph, VertexProperty<ID,java.lang.Long> partitionDistribution)
Label propagation can find communities in a graph relatively fast<ID> Pair<PgxMap<java.lang.Integer,PgxVertex<ID>>,VertexSet<ID>>
computeHighDegreeVertices(PgxGraph graph, int k)
Computes the k vertices with the highest degrees in the graph.<ID> Pair<PgxMap<java.lang.Integer,PgxVertex<ID>>,VertexSet<ID>>
computeHighDegreeVertices(PgxGraph graph, int k, PgxMap<java.lang.Integer,PgxVertex<ID>> highDegreeVertexMapping, VertexSet<ID> highDegreeVertices)
Computes the k vertices with the highest degrees in the graph.<ID> PgxFuture<Pair<PgxMap<java.lang.Integer,PgxVertex<ID>>,VertexSet<ID>>>
computeHighDegreeVerticesAsync(PgxGraph graph, int k)
Computes the k vertices with the highest degrees in the graph.<ID> PgxFuture<Pair<PgxMap<java.lang.Integer,PgxVertex<ID>>,VertexSet<ID>>>
computeHighDegreeVerticesAsync(PgxGraph graph, int k, PgxMap<java.lang.Integer,PgxVertex<ID>> highDegreeVertexMapping, VertexSet<ID> highDegreeVertices)
Computes the k vertices with the highest degrees in the graph.<ID> Scalar<java.lang.Double>
conductance(PgxGraph graph, Partition<ID> partition, long partitionIndex)
Conductance assesses the quality of a partition in a graph<ID> Scalar<java.lang.Double>
conductance(PgxGraph graph, Partition<ID> partition, long partitionIndex, Scalar<java.lang.Double> conductance)
Conductance assesses the quality of a partition in a graph<ID> PgxFuture<Scalar<java.lang.Double>>
conductanceAsync(PgxGraph graph, Partition<ID> partition, long partitionIndex)
Conductance assesses the quality of a partition in a graph<ID> PgxFuture<Scalar<java.lang.Double>>
conductanceAsync(PgxGraph graph, Partition<ID> partition, long partitionIndex, Scalar<java.lang.Double> conductance)
Conductance assesses the quality of a partition in a graphContinuousPropertyConfigBuilder
continuousPropertyConfigBuilder(java.lang.String featureName)
Return a ContinuousPropertyConfigBuilder used to create a ContinuousPropertyConfiglong
countTriangles(PgxGraph graph, boolean sortVerticesByDegree)
triangle counting gives an overview of the amount of connections between vertices in neighborhoodsPgxFuture<java.lang.Long>
countTrianglesAsync(PgxGraph graph, boolean sortVerticesByDegree)
triangle counting gives an overview of the amount of connections between vertices in neighborhoods<ID> VertexProperty<ID,PgxVect<java.lang.Integer>>
createDistanceIndex(PgxGraph graph, PgxMap<java.lang.Integer,PgxVertex<ID>> highDegreeVertexMapping, VertexSet<ID> highDegreeVertices)
Computes an index with distances to each high-degree vertex.<ID> VertexProperty<ID,PgxVect<java.lang.Integer>>
createDistanceIndex(PgxGraph graph, PgxMap<java.lang.Integer,PgxVertex<ID>> highDegreeVertexMapping, VertexSet<ID> highDegreeVertices, VertexProperty<ID,PgxVect<java.lang.Integer>> index)
Computes an index with distances to each high-degree vertex.<ID> PgxFuture<VertexProperty<ID,PgxVect<java.lang.Integer>>>
createDistanceIndexAsync(PgxGraph graph, PgxMap<java.lang.Integer,PgxVertex<ID>> highDegreeVertexMapping, VertexSet<ID> highDegreeVertices)
Computes an index with distances to each high-degree vertex.<ID> PgxFuture<VertexProperty<ID,PgxVect<java.lang.Integer>>>
createDistanceIndexAsync(PgxGraph graph, PgxMap<java.lang.Integer,PgxVertex<ID>> highDegreeVertexMapping, VertexSet<ID> highDegreeVertices, VertexProperty<ID,PgxVect<java.lang.Integer>> index)
Computes an index with distances to each high-degree vertex.DeepWalkModelBuilder
deepWalkModelBuilder()
Builder for Deepwalk model<ID> VertexProperty<ID,java.lang.Integer>
degreeCentrality(PgxGraph graph)
Degree centrality measures the centrality of the vertices based on its degree, letting you see how a vertex influences its neighborhood<ID> VertexProperty<ID,java.lang.Integer>
degreeCentrality(PgxGraph graph, VertexProperty<ID,java.lang.Integer> dc)
Degree centrality measures the centrality of the vertices based on its degree, letting you see how a vertex influences its neighborhood<ID> PgxFuture<VertexProperty<ID,java.lang.Integer>>
degreeCentralityAsync(PgxGraph graph)
Degree centrality measures the centrality of the vertices based on its degree, letting you see how a vertex influences its neighborhood<ID> PgxFuture<VertexProperty<ID,java.lang.Integer>>
degreeCentralityAsync(PgxGraph graph, java.lang.String propertyName)
<ID> PgxFuture<VertexProperty<ID,java.lang.Integer>>
degreeCentralityAsync(PgxGraph graph, VertexProperty<ID,java.lang.Integer> dc)
Degree centrality measures the centrality of the vertices based on its degree, letting you see how a vertex influences its neighborhoodPgxFuture<java.lang.Void>
destroyAsync()
Requests destruction of this object.<ID> Pair<Scalar<java.lang.Integer>,VertexProperty<ID,java.lang.Integer>>
diameter(PgxGraph graph)
Diameter/radius gives an overview of the distances in a graph<ID> Pair<Scalar<java.lang.Integer>,VertexProperty<ID,java.lang.Integer>>
diameter(PgxGraph graph, Scalar<java.lang.Integer> diameter, VertexProperty<ID,java.lang.Integer> eccentricity)
Diameter/radius gives an overview of the distances in a graph<ID> PgxFuture<Pair<Scalar<java.lang.Integer>,VertexProperty<ID,java.lang.Integer>>>
diameterAsync(PgxGraph graph)
Diameter/radius gives an overview of the distances in a graph<ID> PgxFuture<Pair<Scalar<java.lang.Integer>,VertexProperty<ID,java.lang.Integer>>>
diameterAsync(PgxGraph graph, Scalar<java.lang.Integer> diameter, VertexProperty<ID,java.lang.Integer> eccentricity)
Diameter/radius gives an overview of the distances in a graph<ID> VertexProperty<ID,java.lang.Double>
eigenvectorCentrality(PgxGraph graph)
Eigenvector centrality gets the centrality of the vertices in an intricate way using neighbors, allowing to find well-connected vertices<ID> VertexProperty<ID,java.lang.Double>
eigenvectorCentrality(PgxGraph graph, int max, double maxDiff, boolean useL2Norm, boolean useInEdge)
Eigenvector centrality gets the centrality of the vertices in an intricate way using neighbors, allowing to find well-connected vertices<ID> VertexProperty<ID,java.lang.Double>
eigenvectorCentrality(PgxGraph graph, int max, double maxDiff, boolean useL2Norm, boolean useInEdge, VertexProperty<ID,java.lang.Double> ec)
Eigenvector centrality gets the centrality of the vertices in an intricate way using neighbors, allowing to find well-connected vertices<ID> VertexProperty<ID,java.lang.Double>
eigenvectorCentrality(PgxGraph graph, VertexProperty<ID,java.lang.Double> ec)
Eigenvector centrality gets the centrality of the vertices in an intricate way using neighbors, allowing to find well-connected vertices<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
eigenvectorCentralityAsync(PgxGraph graph)
Eigenvector centrality gets the centrality of the vertices in an intricate way using neighbors, allowing to find well-connected vertices<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
eigenvectorCentralityAsync(PgxGraph graph, int max, double maxDiff, boolean useL2Norm, boolean useInEdge)
Eigenvector centrality gets the centrality of the vertices in an intricate way using neighbors, allowing to find well-connected vertices<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
eigenvectorCentralityAsync(PgxGraph graph, int max, double maxDiff, boolean useL2Norm, boolean useInEdge, VertexProperty<ID,java.lang.Double> ec)
Eigenvector centrality gets the centrality of the vertices in an intricate way using neighbors, allowing to find well-connected vertices<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
eigenvectorCentralityAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> ec)
Eigenvector centrality gets the centrality of the vertices in an intricate way using neighbors, allowing to find well-connected vertices<ID> org.apache.commons.lang3.tuple.Triple<ScalarSequence<java.lang.Integer>,VertexSequence<ID>,EdgeSequence>
enumerateSimplePaths(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, int k, VertexSet verticesOnPath, EdgeSet edgesOnPath, PgxMap<PgxVertex<ID>,java.lang.Integer> dist)
Enumerate all simple paths between the source and destination vertex<ID> PgxFuture<org.apache.commons.lang3.tuple.Triple<ScalarSequence<java.lang.Integer>,VertexSequence<ID>,EdgeSequence>>
enumerateSimplePathsAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, int k, VertexSet verticesOnPath, EdgeSet edgesOnPath, PgxMap<PgxVertex<ID>,java.lang.Integer> dist)
Enumerate all simple paths between the source and destination vertex<ID> AllPaths<ID>
fattestPath(PgxGraph graph, ID rootId, EdgeProperty<java.lang.Double> capacity)
Convenience wrapper aroundfattestPath(PgxGraph, PgxVertex, EdgeProperty)
taking a vertex ID instead of aPgxVertex
.<ID> AllPaths<ID>
fattestPath(PgxGraph graph, ID rootId, EdgeProperty<java.lang.Double> capacity, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Convenience wrapper aroundfattestPath(PgxGraph, PgxVertex, EdgeProperty, VertexProperty, VertexProperty, VertexProperty)
taking a vertex ID instead of aPgxVertex
.<ID> AllPaths<ID>
fattestPath(PgxGraph graph, PgxVertex<ID> root, EdgeProperty<java.lang.Double> capacity)
Fattest path is a fast algorithm for finding a shortest path adding constraints for flowing related matters<ID> AllPaths<ID>
fattestPath(PgxGraph graph, PgxVertex<ID> root, EdgeProperty<java.lang.Double> capacity, boolean ignoreEdgeDirection)
Undirected Fattest path is variation of the fattest graph algorithm that ignores edge directions.<ID> AllPaths<ID>
fattestPath(PgxGraph graph, PgxVertex<ID> root, EdgeProperty<java.lang.Double> capacity, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Fattest path is a fast algorithm for finding a shortest path adding constraints for flowing related matters<ID> AllPaths<ID>
fattestPath(PgxGraph graph, PgxVertex<ID> root, EdgeProperty<java.lang.Double> capacity, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge, boolean ignoreEdgeDirection)
Undirected Fattest path is variation of the fattest graph algorithm that ignores edge directions.<ID> PgxFuture<AllPaths<ID>>
fattestPathAsync(PgxGraph graph, PgxVertex<ID> root, EdgeProperty<java.lang.Double> capacity)
Fattest path is a fast algorithm for finding a shortest path adding constraints for flowing related matters<ID> PgxFuture<AllPaths<ID>>
fattestPathAsync(PgxGraph graph, PgxVertex<ID> root, EdgeProperty<java.lang.Double> capacity, boolean ignoreEdgeDirection)
Undirected Fattest path is variation of the fattest graph algorithm that ignores edge directions.<ID> PgxFuture<AllPaths<ID>>
fattestPathAsync(PgxGraph graph, PgxVertex<ID> root, EdgeProperty<java.lang.Double> capacity, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Fattest path is a fast algorithm for finding a shortest path adding constraints for flowing related matters<ID> PgxFuture<AllPaths<ID>>
fattestPathAsync(PgxGraph graph, PgxVertex<ID> root, EdgeProperty<java.lang.Double> capacity, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge, boolean ignoreEdgeDirection)
Undirected Fattest path is variation of the fattest graph algorithm that ignores edge directions.<ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>
filteredBfs(PgxGraph graph, ID root)
Convenience wrapper aroundfilteredBfs(PgxGraph, PgxVertex)
taking a vertex ID instead ofPgxVertex
.<ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>
filteredBfs(PgxGraph graph, ID root, int maxDepth)
Convenience wrapper aroundfilteredBfs(PgxGraph, PgxVertex, int)
taking a vertex ID instead ofPgxVertex
.<ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>
filteredBfs(PgxGraph graph, PgxVertex<ID> root)
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>
filteredBfs(PgxGraph graph, PgxVertex<ID> root, int maxDepth)
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>
filteredBfs(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator)
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>
filteredBfs(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf)
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>
filteredBfs(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf, int maxDepth)
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>
filteredBfs(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf, int maxDepth, VertexProperty<ID,java.lang.Integer> distance, VertexProperty<ID,PgxVertex<ID>> parent)
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>
filteredBfs(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf, VertexProperty<ID,java.lang.Integer> distance, VertexProperty<ID,PgxVertex<ID>> parent)
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>
filteredBfs(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, int maxDepth)
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>>
filteredBfsAsync(PgxGraph graph, PgxVertex<ID> root)
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>>
filteredBfsAsync(PgxGraph graph, PgxVertex<ID> root, int maxDepth)
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>>
filteredBfsAsync(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator)
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>>
filteredBfsAsync(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf)
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>>
filteredBfsAsync(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf, int maxDepth)
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>>
filteredBfsAsync(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf, int maxDepth, VertexProperty<ID,java.lang.Integer> distance, VertexProperty<ID,PgxVertex<ID>> parent)
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>>
filteredBfsAsync(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf, VertexProperty<ID,java.lang.Integer> distance, VertexProperty<ID,PgxVertex<ID>> parent)
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>>
filteredBfsAsync(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, int maxDepth)
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>
filteredDfs(PgxGraph graph, ID root)
Convenience wrapper aroundfilteredDfs(PgxGraph, PgxVertex)
taking a vertex ID instead ofPgxVertex
.<ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>
filteredDfs(PgxGraph graph, ID root, int maxDepth)
Convenience wrapper aroundfilteredDfs(PgxGraph, PgxVertex, int)
taking a vertex ID instead ofPgxVertex
.<ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>
filteredDfs(PgxGraph graph, PgxVertex<ID> root)
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>
filteredDfs(PgxGraph graph, PgxVertex<ID> root, int maxDepth)
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>
filteredDfs(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator)
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>
filteredDfs(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf)
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>
filteredDfs(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf, int maxDepth)
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>
filteredDfs(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf, int maxDepth, VertexProperty<ID,java.lang.Integer> distance, VertexProperty<ID,PgxVertex<ID>> parent)
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>
filteredDfs(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf, VertexProperty<ID,java.lang.Integer> distance, VertexProperty<ID,PgxVertex<ID>> parent)
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>
filteredDfs(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, int maxDepth)
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>>
filteredDfsAsync(PgxGraph graph, PgxVertex<ID> root)
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>>
filteredDfsAsync(PgxGraph graph, PgxVertex<ID> root, int maxDepth)
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>>
filteredDfsAsync(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator)
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>>
filteredDfsAsync(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf)
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>>
filteredDfsAsync(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf, int maxDepth)
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>>
filteredDfsAsync(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf, int maxDepth, VertexProperty<ID,java.lang.Integer> distance, VertexProperty<ID,PgxVertex<ID>> parent)
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>>
filteredDfsAsync(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf, VertexProperty<ID,java.lang.Integer> distance, VertexProperty<ID,PgxVertex<ID>> parent)
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>>
filteredDfsAsync(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, int maxDepth)
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.<ID> VertexProperty<ID,java.lang.String>
filteredSpeakerListenerLabelPropagation(PgxGraph graph, java.lang.String labelsPropName, int maxIter, double threshold, java.lang.String delimiter, EdgeFilter filter)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.<ID> VertexProperty<ID,java.lang.String>
filteredSpeakerListenerLabelPropagation(PgxGraph graph, java.lang.String labelsPropName, EdgeFilter filter)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.<ID> VertexProperty<ID,java.lang.String>
filteredSpeakerListenerLabelPropagation(PgxGraph graph, VertexProperty<ID,java.lang.String> labels, int maxIter, double threshold, java.lang.String delimiter, EdgeFilter filter)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.<ID> PgxFuture<VertexProperty<ID,java.lang.String>>
filteredSpeakerListenerLabelPropagationAsync(PgxGraph graph, java.lang.String labelsPropName, int maxIter, double threshold, java.lang.String delimiter, EdgeFilter filter)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.<ID> PgxFuture<VertexProperty<ID,java.lang.String>>
filteredSpeakerListenerLabelPropagationAsync(PgxGraph graph, java.lang.String labelsPropName, EdgeFilter filter)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.<ID> PgxFuture<VertexProperty<ID,java.lang.String>>
filteredSpeakerListenerLabelPropagationAsync(PgxGraph graph, VertexProperty<ID,java.lang.String> labels, int maxIter, double threshold, java.lang.String delimiter, EdgeFilter filter)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.<ID> VertexProperty<ID,java.lang.String>
filteredWeightedSpeakerListenerLabelPropagation(PgxGraph graph, java.lang.String labelsPropName, int maxIter, double threshold, java.lang.String delimiter, EdgeProperty<java.lang.Double> weight, EdgeFilter filter)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.<ID> VertexProperty<ID,java.lang.String>
filteredWeightedSpeakerListenerLabelPropagation(PgxGraph graph, java.lang.String labelsPropName, EdgeProperty<java.lang.Double> weight, EdgeFilter filter)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.<ID> VertexProperty<ID,java.lang.String>
filteredWeightedSpeakerListenerLabelPropagation(PgxGraph graph, VertexProperty<ID,java.lang.String> labels, int maxIter, double threshold, java.lang.String delimiter, EdgeProperty<java.lang.Double> weight, EdgeFilter filter)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.<ID> PgxFuture<VertexProperty<ID,java.lang.String>>
filteredWeightedSpeakerListenerLabelPropagationAsync(PgxGraph graph, java.lang.String labelsPropName, int maxIter, double threshold, java.lang.String delimiter, EdgeProperty<java.lang.Double> weight, EdgeFilter filter)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.<ID> PgxFuture<VertexProperty<ID,java.lang.String>>
filteredWeightedSpeakerListenerLabelPropagationAsync(PgxGraph graph, java.lang.String labelsPropName, EdgeProperty<java.lang.Double> weight, EdgeFilter filter)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.<ID> PgxFuture<VertexProperty<ID,java.lang.String>>
filteredWeightedSpeakerListenerLabelPropagationAsync(PgxGraph graph, VertexProperty<ID,java.lang.String> labels, int maxIter, double threshold, java.lang.String delimiter, EdgeProperty<java.lang.Double> weight, EdgeFilter filter)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.<ID> PgxPath<ID>
findCycle(PgxGraph graph)
Find cycle looks for any loop in the graph.<ID> PgxPath<ID>
findCycle(PgxGraph graph, PgxVertex<ID> src)
Find cycle looks for any loop in the graph.<ID> PgxPath<ID>
findCycle(PgxGraph graph, PgxVertex<ID> src, VertexSequence<ID> nodeSeq, EdgeSequence edgeSeq)
Find cycle looks for any loop in the graph.<ID> PgxPath<ID>
findCycle(PgxGraph graph, VertexSequence<ID> nodeSeq, EdgeSequence edgeSeq)
Find cycle looks for any loop in the graph.<ID> PgxFuture<PgxPath<ID>>
findCycleAsync(PgxGraph graph)
Find cycle looks for any loop in the graph.<ID> PgxFuture<PgxPath<ID>>
findCycleAsync(PgxGraph graph, PgxVertex<ID> src)
Find cycle looks for any loop in the graph.<ID> PgxFuture<PgxPath<ID>>
findCycleAsync(PgxGraph graph, PgxVertex<ID> src, VertexSequence<ID> nodeSeq, EdgeSequence edgeSeq)
Find cycle looks for any loop in the graph.<ID> PgxFuture<PgxPath<ID>>
findCycleAsync(PgxGraph graph, VertexSequence<ID> nodeSeq, EdgeSequence edgeSeq)
Find cycle looks for any loop in the graph.PgxSession
getSession()
Gets the session.GraphWiseAttentionLayerConfigBuilder
graphWiseAttentionLayerConfigBuilder()
Return a GraphWiseAttentionLayerConfigBuilder used to create a GraphWiseAttentionLayerConfigGraphWiseConvLayerConfigBuilder
graphWiseConvLayerConfigBuilder()
Return a GraphWiseConvLayerConfigBuilder used to create a GraphWiseConvLayerConfigGraphWiseDgiLayerConfigBuilder
graphWiseDgiLayerConfigBuilder()
Return a GraphWiseDgiLayerConfigBuilder used to create a GraphWiseDgiLayerConfigGraphWiseDominantLayerConfigBuilder
graphWiseDominantLayerConfigBuilder()
Return a GraphWiseDominantLayerConfigBuilder used to create a GraphWiseDominantLayerConfigGraphWisePredictionLayerConfigBuilder
graphWisePredictionLayerConfigBuilder()
Return a GraphWisePredictionLayerConfigBuilder used to create a GraphWiseLayerConfigGraphWiseValidationConfigBuilder
graphWiseValidationConfigBuilder()
Return a GraphWiseValidationConfigBuilder used to create a GraphWiseValidationConfig<ID> VertexProperty<ID,java.lang.Double>
harmonicCentrality(PgxGraph graph)
Harmonic centrality measures node importance by considering the reciprocal of the sum of shortest path distances in the network.<ID> VertexProperty<ID,java.lang.Double>
harmonicCentrality(PgxGraph graph, VertexProperty<ID,java.lang.Double> hc)
Harmonic centrality measures node importance by considering the reciprocal of the sum of shortest path distances in the network.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
harmonicCentralityAsync(PgxGraph graph)
Harmonic centrality measures node importance by considering the reciprocal of the sum of shortest path distances in the network.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
harmonicCentralityAsync(PgxGraph graph, java.lang.String propertyName)
<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
harmonicCentralityAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> hc)
Harmonic centrality measures node importance by considering the reciprocal of the sum of shortest path distances in the network.<ID> Pair<VertexProperty<ID,java.lang.Double>,VertexProperty<ID,java.lang.Double>>
hits(PgxGraph graph)
HITS assigns ranking scores to the vertices, aimed to assess the quality of information and references in linked structures<ID> Pair<VertexProperty<ID,java.lang.Double>,VertexProperty<ID,java.lang.Double>>
hits(PgxGraph graph, int max)
HITS assigns ranking scores to the vertices, aimed to assess the quality of information and references in linked structures<ID> Pair<VertexProperty<ID,java.lang.Double>,VertexProperty<ID,java.lang.Double>>
hits(PgxGraph graph, int max, VertexProperty<ID,java.lang.Double> auth, VertexProperty<ID,java.lang.Double> hubs)
HITS assigns ranking scores to the vertices, aimed to assess the quality of information and references in linked structures<ID> Pair<VertexProperty<ID,java.lang.Double>,VertexProperty<ID,java.lang.Double>>
hits(PgxGraph graph, VertexProperty<ID,java.lang.Double> auth, VertexProperty<ID,java.lang.Double> hubs)
HITS assigns ranking scores to the vertices, aimed to assess the quality of information and references in linked structures<ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Double>,VertexProperty<ID,java.lang.Double>>>
hitsAsync(PgxGraph graph)
HITS assigns ranking scores to the vertices, aimed to assess the quality of information and references in linked structures<ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Double>,VertexProperty<ID,java.lang.Double>>>
hitsAsync(PgxGraph graph, int max)
HITS assigns ranking scores to the vertices, aimed to assess the quality of information and references in linked structures<ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Double>,VertexProperty<ID,java.lang.Double>>>
hitsAsync(PgxGraph graph, int max, VertexProperty<ID,java.lang.Double> auth, VertexProperty<ID,java.lang.Double> hubs)
HITS assigns ranking scores to the vertices, aimed to assess the quality of information and references in linked structures<ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Double>,VertexProperty<ID,java.lang.Double>>>
hitsAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> auth, VertexProperty<ID,java.lang.Double> hubs)
HITS assigns ranking scores to the vertices, aimed to assess the quality of information and references in linked structures<ID> VertexProperty<ID,java.lang.Integer>
inDegreeCentrality(PgxGraph graph)
In-degree centrality measures the centrality of the vertices based on its degree, letting you see how a vertex influences its neighborhood<ID> VertexProperty<ID,java.lang.Integer>
inDegreeCentrality(PgxGraph graph, VertexProperty<ID,java.lang.Integer> dc)
In-degree centrality measures the centrality of the vertices based on its degree, letting you see how a vertex influences its neighborhood<ID> PgxFuture<VertexProperty<ID,java.lang.Integer>>
inDegreeCentralityAsync(PgxGraph graph)
In-degree centrality measures the centrality of the vertices based on its degree, letting you see how a vertex influences its neighborhood<ID> PgxFuture<VertexProperty<ID,java.lang.Integer>>
inDegreeCentralityAsync(PgxGraph graph, java.lang.String propertyName)
<ID> PgxFuture<VertexProperty<ID,java.lang.Integer>>
inDegreeCentralityAsync(PgxGraph graph, VertexProperty<ID,java.lang.Integer> dc)
In-degree centrality measures the centrality of the vertices based on its degree, letting you see how a vertex influences its neighborhoodPgxMap<java.lang.Integer,java.lang.Long>
inDegreeDistribution(PgxGraph graph)
In-degree distribution gives information about the incoming flows in a graphPgxMap<java.lang.Integer,java.lang.Long>
inDegreeDistribution(PgxGraph graph, PgxMap<java.lang.Integer,java.lang.Long> distribution)
In-degree distribution gives information about the incoming flows in a graphPgxFuture<PgxMap<java.lang.Integer,java.lang.Long>>
inDegreeDistributionAsync(PgxGraph graph)
In-degree distribution gives information about the incoming flows in a graphPgxFuture<PgxMap<java.lang.Integer,java.lang.Long>>
inDegreeDistributionAsync(PgxGraph graph, PgxMap<java.lang.Integer,java.lang.Long> distribution)
In-degree distribution gives information about the incoming flows in a graph<ID> Pair<Scalar<java.lang.Long>,VertexProperty<ID,java.lang.Long>>
kcore(PgxGraph graph)
k-core decomposes a graph into layers revealing subgraphs with particular properties<ID> Pair<Scalar<java.lang.Long>,VertexProperty<ID,java.lang.Long>>
kcore(PgxGraph graph, int minCore, int maxCore)
k-core decomposes a graph into layers revealing subgraphs with particular properties<ID> Pair<Scalar<java.lang.Long>,VertexProperty<ID,java.lang.Long>>
kcore(PgxGraph graph, int minCore, int maxCore, Scalar<java.lang.Long> maxKCore, VertexProperty<ID,java.lang.Long> kcore)
k-core decomposes a graph into layers revealing subgraphs with particular properties<ID> Pair<Scalar<java.lang.Long>,VertexProperty<ID,java.lang.Long>>
kcore(PgxGraph graph, Scalar<java.lang.Long> maxKCore, VertexProperty<ID,java.lang.Long> kcore)
k-core decomposes a graph into layers revealing subgraphs with particular properties<ID> PgxFuture<Pair<Scalar<java.lang.Long>,VertexProperty<ID,java.lang.Long>>>
kcoreAsync(PgxGraph graph)
k-core decomposes a graph into layers revealing subgraphs with particular properties<ID> PgxFuture<Pair<Scalar<java.lang.Long>,VertexProperty<ID,java.lang.Long>>>
kcoreAsync(PgxGraph graph, int minCore, int maxCore)
k-core decomposes a graph into layers revealing subgraphs with particular properties<ID> PgxFuture<Pair<Scalar<java.lang.Long>,VertexProperty<ID,java.lang.Long>>>
kcoreAsync(PgxGraph graph, int minCore, int maxCore, Scalar<java.lang.Long> maxKCore, VertexProperty<ID,java.lang.Long> kcore)
k-core decomposes a graph into layers revealing subgraphs with particular properties<ID> PgxFuture<Pair<Scalar<java.lang.Long>,VertexProperty<ID,java.lang.Long>>>
kcoreAsync(PgxGraph graph, Scalar<java.lang.Long> maxKCore, VertexProperty<ID,java.lang.Long> kcore)
k-core decomposes a graph into layers revealing subgraphs with particular properties<ID> Pair<VertexSequence<ID>,EdgeSequence>
limitedShortestPathHopDist(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, int maxHops, PgxMap<java.lang.Integer,PgxVertex<ID>> highDegreeVertexMapping, VertexSet<ID> highDegreeVertices, VertexProperty<ID,PgxVect<java.lang.Integer>> index)
Computes the k-hop limited shortest path between two vertices.<ID> Pair<VertexSequence<ID>,EdgeSequence>
limitedShortestPathHopDist(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, int maxHops, PgxMap<java.lang.Integer,PgxVertex<ID>> highDegreeVertexMapping, VertexSet<ID> highDegreeVertices, VertexProperty<ID,PgxVect<java.lang.Integer>> index, VertexSequence<ID> pathVertices, EdgeSequence pathEdges)
Computes the k-hop limited shortest path between two vertices.<ID> PgxFuture<Pair<VertexSequence<ID>,EdgeSequence>>
limitedShortestPathHopDistAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, int maxHops, PgxMap<java.lang.Integer,PgxVertex<ID>> highDegreeVertexMapping, VertexSet<ID> highDegreeVertices, VertexProperty<ID,PgxVect<java.lang.Integer>> index)
Computes the k-hop limited shortest path between two vertices.<ID> PgxFuture<Pair<VertexSequence<ID>,EdgeSequence>>
limitedShortestPathHopDistAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, int maxHops, PgxMap<java.lang.Integer,PgxVertex<ID>> highDegreeVertexMapping, VertexSet<ID> highDegreeVertices, VertexProperty<ID,PgxVect<java.lang.Integer>> index, VertexSequence<ID> pathVertices, EdgeSequence pathEdges)
Computes the k-hop limited shortest path between two vertices.<ID> Pair<VertexSequence<ID>,EdgeSequence>
limitedShortestPathHopDistFiltered(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, int maxHops, PgxMap<java.lang.Integer,PgxVertex<ID>> highDegreeVertexMapping, VertexSet<ID> highDegreeVertices, VertexProperty<ID,PgxVect<java.lang.Integer>> index, EdgeFilter filter)
Computes the k-hop limited shortest path between two vertices.<ID> Pair<VertexSequence<ID>,EdgeSequence>
limitedShortestPathHopDistFiltered(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, int maxHops, PgxMap<java.lang.Integer,PgxVertex<ID>> highDegreeVertexMapping, VertexSet<ID> highDegreeVertices, VertexProperty<ID,PgxVect<java.lang.Integer>> index, EdgeFilter filter, VertexSequence<ID> pathVertices, EdgeSequence pathEdges)
Computes the k-hop limited shortest path between two vertices.<ID> PgxFuture<Pair<VertexSequence<ID>,EdgeSequence>>
limitedShortestPathHopDistFilteredAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, int maxHops, PgxMap<java.lang.Integer,PgxVertex<ID>> highDegreeVertexMapping, VertexSet<ID> highDegreeVertices, VertexProperty<ID,PgxVect<java.lang.Integer>> index, EdgeFilter filter)
Computes the k-hop limited shortest path between two vertices.<ID> PgxFuture<Pair<VertexSequence<ID>,EdgeSequence>>
limitedShortestPathHopDistFilteredAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, int maxHops, PgxMap<java.lang.Integer,PgxVertex<ID>> highDegreeVertexMapping, VertexSet<ID> highDegreeVertices, VertexProperty<ID,PgxVect<java.lang.Integer>> index, EdgeFilter filter, VertexSequence<ID> pathVertices, EdgeSequence pathEdges)
Computes the k-hop limited shortest path between two vertices.GenericModelLoader<DeepWalkModel>
loadDeepWalkModel()
ReturnsGenericModelLoader
to configure how to load a DeepWalk model and then trigger it.DeepWalkModel
loadDeepWalkModel(java.lang.String path, java.lang.String key)
Loads an encrypted Deepwalk modelGenericModelLoader<Pg2vecModel>
loadPg2vecModel()
ReturnsGenericModelLoader
to configure how to load a Pg2vec model and then trigger it.Pg2vecModel
loadPg2vecModel(java.lang.String path, java.lang.String key)
Loads an encrypted pg2vec modelGenericModelLoader<SupervisedEdgeWiseModel>
loadSupervisedEdgeWiseModel()
ReturnsGenericModelLoader
to configure how to load a SupervisedEdgeWiseModel model and then trigger it.SupervisedEdgeWiseModel
loadSupervisedEdgeWiseModel(java.lang.String path, java.lang.String key)
Loads an encrypted SupervisedEdgeWise modelGenericModelLoader<SupervisedGraphWiseModel>
loadSupervisedGraphWiseModel()
ReturnsGenericModelLoader
to configure how to load a SupervisedGraphWiseModel model and then trigger it.SupervisedGraphWiseModel
loadSupervisedGraphWiseModel(java.lang.String path, java.lang.String key)
Loads an encrypted SupervisedGraphWise modelGenericModelLoader<UnsupervisedAnomalyDetectionGraphWiseModel>
loadUnsupervisedAnomalyDetectionGraphWiseModel()
ReturnsGenericModelLoader
to configure how to load a UnsupervisedAnomalyDetectionGraphWise model and then trigger it.GenericModelLoader<UnsupervisedEdgeWiseModel>
loadUnsupervisedEdgeWiseModel()
ReturnsGenericModelLoader
to configure how to load a UnsupervisedEdgeWiseModel model and then trigger it.UnsupervisedEdgeWiseModel
loadUnsupervisedEdgeWiseModel(java.lang.String path, java.lang.String key)
Loads an encrypted UnsupervisedEdgeWise modelGenericModelLoader<UnsupervisedGraphWiseModel>
loadUnsupervisedGraphWiseModel()
ReturnsGenericModelLoader
to configure how to load a UnsupervisedGraphWise model and then trigger it.UnsupervisedGraphWiseModel
loadUnsupervisedGraphWiseModel(java.lang.String path, java.lang.String key)
Loads an encrypted UnsupervisedGraphWise model<ID> VertexProperty<ID,java.lang.Double>
localClusteringCoefficient(PgxGraph graph)
LCC gives information about potential clustering options in a graph<ID> VertexProperty<ID,java.lang.Double>
localClusteringCoefficient(PgxGraph graph, boolean ignoreEdgeDirection)
LCC gives information about potential clustering options in a graph<ID> VertexProperty<ID,java.lang.Double>
localClusteringCoefficient(PgxGraph graph, VertexProperty<ID,java.lang.Double> lcc)
LCC gives information about potential clustering options in a graph<ID> VertexProperty<ID,java.lang.Double>
localClusteringCoefficient(PgxGraph graph, VertexProperty<ID,java.lang.Double> lcc, boolean ignoreEdgeDirection)
LCC gives information about potential clustering options in a graph<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
localClusteringCoefficientAsync(PgxGraph graph)
LCC gives information about potential clustering options in a graph<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
localClusteringCoefficientAsync(PgxGraph graph, boolean ignoreEdgeDirection)
LCC gives information about potential clustering options in a graph<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
localClusteringCoefficientAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> lcc)
LCC gives information about potential clustering options in a graph<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
localClusteringCoefficientAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> lcc, boolean ignoreEdgeDirection)
LCC gives information about potential clustering options in a graph<ID> VertexProperty<ID,java.lang.Long>
louvain(PgxGraph graph, EdgeProperty<java.lang.Double> weight)
Louvain can detect communities in a large graph relatively fast.<ID> VertexProperty<ID,java.lang.Long>
louvain(PgxGraph graph, EdgeProperty<java.lang.Double> weight, int maxIter)
Louvain can detect communities in a large graph relatively fast.<ID> VertexProperty<ID,java.lang.Long>
louvain(PgxGraph graph, EdgeProperty<java.lang.Double> weight, int maxIter, int nbrPass, double tol, VertexProperty<ID,java.lang.Long> community)
Louvain can detect communities in a large graph relatively fast.<ID> PgxFuture<VertexProperty<ID,java.lang.Long>>
louvainAsync(PgxGraph graph, EdgeProperty<java.lang.Double> weight)
Louvain can detect communities in a large graph relatively fast.<ID> PgxFuture<VertexProperty<ID,java.lang.Long>>
louvainAsync(PgxGraph graph, EdgeProperty<java.lang.Double> weight, int maxIter)
Louvain can detect communities in a large graph relatively fast.<ID> PgxFuture<VertexProperty<ID,java.lang.Long>>
louvainAsync(PgxGraph graph, EdgeProperty<java.lang.Double> weight, int maxIter, int nbrPass, double tol, VertexProperty<ID,java.lang.Long> community)
Louvain can detect communities in a large graph relatively fast.<ID> MatrixFactorizationModel<ID>
matrixFactorizationGradientDescent(BipartiteGraph graph, EdgeProperty<java.lang.Double> weight)
Matrix factorization can be used as a recommendation algorithm for bipartite graphs<ID> MatrixFactorizationModel<ID>
matrixFactorizationGradientDescent(BipartiteGraph graph, EdgeProperty<java.lang.Double> weight, double learningRate, double changePerStep, double lambda, int maxStep, int vectorLength)
Matrix factorization can be used as a recommendation algorithm for bipartite graphs<ID> MatrixFactorizationModel<ID>
matrixFactorizationGradientDescent(BipartiteGraph graph, EdgeProperty<java.lang.Double> weight, double learningRate, double changePerStep, double lambda, int maxStep, int vectorLength, VertexProperty<ID,PgxVect<java.lang.Double>> features)
Matrix factorization can be used as a recommendation algorithm for bipartite graphs<ID> MatrixFactorizationModel<ID>
matrixFactorizationGradientDescent(BipartiteGraph graph, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,PgxVect<java.lang.Double>> features)
Matrix factorization can be used as a recommendation algorithm for bipartite graphs<ID> PgxFuture<MatrixFactorizationModel<ID>>
matrixFactorizationGradientDescentAsync(BipartiteGraph graph, EdgeProperty<java.lang.Double> weight)
Matrix factorization can be used as a recommendation algorithm for bipartite graphs<ID> PgxFuture<MatrixFactorizationModel<ID>>
matrixFactorizationGradientDescentAsync(BipartiteGraph graph, EdgeProperty<java.lang.Double> weight, double learningRate, double changePerStep, double lambda, int maxStep, int vectorLength)
Matrix factorization can be used as a recommendation algorithm for bipartite graphs<ID> PgxFuture<MatrixFactorizationModel<ID>>
matrixFactorizationGradientDescentAsync(BipartiteGraph graph, EdgeProperty<java.lang.Double> weight, double learningRate, double changePerStep, double lambda, int maxStep, int vectorLength, VertexProperty<ID,PgxVect<java.lang.Double>> features)
Matrix factorization can be used as a recommendation algorithm for bipartite graphs<ID> PgxFuture<MatrixFactorizationModel<ID>>
matrixFactorizationGradientDescentAsync(BipartiteGraph graph, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,PgxVect<java.lang.Double>> features)
Matrix factorization can be used as a recommendation algorithm for bipartite graphs<ID> VertexProperty<ID,java.lang.Double>
matrixFactorizationRecommendations(BipartiteGraph graph, ID user, int vectorLength, VertexProperty<ID,PgxVect<java.lang.Double>> feature, VertexProperty<ID,java.lang.Double> estimatedRating)
Convenience wrapper aroundmatrixFactorizationRecommendations(BipartiteGraph, PgxVertex, int, VertexProperty, VertexProperty)
taking a vertex ID instead of aPgxVertex
.<ID> VertexProperty<ID,java.lang.Double>
matrixFactorizationRecommendations(BipartiteGraph graph, PgxVertex<ID> user, int vectorLength, VertexProperty<ID,PgxVect<java.lang.Double>> feature, VertexProperty<ID,java.lang.Double> estimatedRating)
Estimate rating can be used as a prediction algorithm for bipartite graphs<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
matrixFactorizationRecommendationsAsync(BipartiteGraph graph, PgxVertex<ID> user, int vectorLength, VertexProperty<ID,PgxVect<java.lang.Double>> feature, VertexProperty<ID,java.lang.Double> estimatedRating)
Estimate rating can be used as a prediction algorithm for bipartite graphsGenericModelRepositoryBuilder
modelRepository()
Builder for model repository.<ID> VertexProperty<ID,java.lang.Integer>
outDegreeCentrality(PgxGraph graph)
Out-degree centrality measures the centrality of the vertices based on its degree, letting you see how a vertex influences its neighborhood<ID> VertexProperty<ID,java.lang.Integer>
outDegreeCentrality(PgxGraph graph, VertexProperty<ID,java.lang.Integer> dc)
Out-degree centrality measures the centrality of the vertices based on its degree, letting you see how a vertex influences its neighborhood<ID> PgxFuture<VertexProperty<ID,java.lang.Integer>>
outDegreeCentralityAsync(PgxGraph graph)
Out-degree centrality measures the centrality of the vertices based on its degree, letting you see how a vertex influences its neighborhood<ID> PgxFuture<VertexProperty<ID,java.lang.Integer>>
outDegreeCentralityAsync(PgxGraph graph, java.lang.String propertyName)
<ID> PgxFuture<VertexProperty<ID,java.lang.Integer>>
outDegreeCentralityAsync(PgxGraph graph, VertexProperty<ID,java.lang.Integer> dc)
Out-degree centrality measures the centrality of the vertices based on its degree, letting you see how a vertex influences its neighborhoodPgxMap<java.lang.Integer,java.lang.Long>
outDegreeDistribution(PgxGraph graph)
Out-degree distribution gives information about the outgoing flows in a graphPgxMap<java.lang.Integer,java.lang.Long>
outDegreeDistribution(PgxGraph graph, PgxMap<java.lang.Integer,java.lang.Long> distribution)
Out-degree distribution gives information about the outgoing flows in a graphPgxFuture<PgxMap<java.lang.Integer,java.lang.Long>>
outDegreeDistributionAsync(PgxGraph graph)
Out-degree distribution gives information about the outgoing flows in a graphPgxFuture<PgxMap<java.lang.Integer,java.lang.Long>>
outDegreeDistributionAsync(PgxGraph graph, PgxMap<java.lang.Integer,java.lang.Long> distribution)
Out-degree distribution gives information about the outgoing flows in a graph<ID> VertexProperty<ID,java.lang.Double>
pagerank(PgxGraph graph)
PageRank computes ranking scores based on the edges in a graph.<ID> VertexProperty<ID,java.lang.Double>
pagerank(PgxGraph graph, boolean norm)
PageRank computes ranking scores based on the edges in a graph.<ID> VertexProperty<ID,java.lang.Double>
pagerank(PgxGraph graph, boolean norm, VertexProperty<ID,java.lang.Double> rank)
PageRank computes ranking scores based on the edges in a graph.<ID> VertexProperty<ID,java.lang.Double>
pagerank(PgxGraph graph, double e, double d, int max)
PageRank computes ranking scores based on the edges in a graph.<ID> VertexProperty<ID,java.lang.Double>
pagerank(PgxGraph graph, double e, double d, int max, boolean norm)
PageRank computes ranking scores based on the edges in a graph.<ID> VertexProperty<ID,java.lang.Double>
pagerank(PgxGraph graph, double e, double d, int max, boolean norm, VertexProperty<ID,java.lang.Double> rank)
PageRank computes ranking scores based on the edges in a graph.<ID> VertexProperty<ID,java.lang.Double>
pagerank(PgxGraph graph, double e, double d, int max, VertexProperty<ID,java.lang.Double> rank)
PageRank computes ranking scores based on the edges in a graph.<ID> VertexProperty<ID,java.lang.Double>
pagerank(PgxGraph graph, VertexProperty<ID,java.lang.Double> rank)
PageRank computes ranking scores based on the edges in a graph.<ID> VertexProperty<ID,java.lang.Double>
pagerankApproximate(PgxGraph graph)
Faster, but less accurate than pagerank.<ID> VertexProperty<ID,java.lang.Double>
pagerankApproximate(PgxGraph graph, double e, double d, int max)
Faster, but less accurate than pagerank.<ID> VertexProperty<ID,java.lang.Double>
pagerankApproximate(PgxGraph graph, double e, double d, int max, VertexProperty<ID,java.lang.Double> rank)
Faster, but less accurate than pagerank.<ID> VertexProperty<ID,java.lang.Double>
pagerankApproximate(PgxGraph graph, VertexProperty<ID,java.lang.Double> rank)
Faster, but less accurate than pagerank.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
pagerankApproximateAsync(PgxGraph graph)
Faster, but less accurate than pagerank.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
pagerankApproximateAsync(PgxGraph graph, double e, double d, int max)
Faster, but less accurate than pagerank.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
pagerankApproximateAsync(PgxGraph graph, double e, double d, int max, VertexProperty<ID,java.lang.Double> rank)
Faster, but less accurate than pagerank.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
pagerankApproximateAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> rank)
Faster, but less accurate than pagerank.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
pagerankAsync(PgxGraph graph)
PageRank computes ranking scores based on the edges in a graph.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
pagerankAsync(PgxGraph graph, boolean norm)
PageRank computes ranking scores based on the edges in a graph.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
pagerankAsync(PgxGraph graph, boolean norm, VertexProperty<ID,java.lang.Double> rank)
PageRank computes ranking scores based on the edges in a graph.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
pagerankAsync(PgxGraph graph, double e, double d, int max)
PageRank computes ranking scores based on the edges in a graph.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
pagerankAsync(PgxGraph graph, double e, double d, int max, boolean norm)
PageRank computes ranking scores based on the edges in a graph.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
pagerankAsync(PgxGraph graph, double e, double d, int max, boolean norm, VertexProperty<ID,java.lang.Double> rank)
PageRank computes ranking scores based on the edges in a graph.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
pagerankAsync(PgxGraph graph, double e, double d, int max, VertexProperty<ID,java.lang.Double> rank)
PageRank computes ranking scores based on the edges in a graph.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
pagerankAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> rank)
PageRank computes ranking scores based on the edges in a graph.<ID> Pair<Scalar<java.lang.Double>,Scalar<java.lang.Double>>
partitionConductance(PgxGraph graph, Partition<ID> partition)
Partition conductance assesses the quality of many partitions in a graph<ID> Pair<Scalar<java.lang.Double>,Scalar<java.lang.Double>>
partitionConductance(PgxGraph graph, Partition<ID> partition, Scalar<java.lang.Double> avgConductance, Scalar<java.lang.Double> minConductance)
Partition conductance assesses the quality of many partitions in a graph<ID> PgxFuture<Pair<Scalar<java.lang.Double>,Scalar<java.lang.Double>>>
partitionConductanceAsync(PgxGraph graph, Partition<ID> partition)
Partition conductance assesses the quality of many partitions in a graph<ID> PgxFuture<Pair<Scalar<java.lang.Double>,Scalar<java.lang.Double>>>
partitionConductanceAsync(PgxGraph graph, Partition<ID> partition, Scalar<java.lang.Double> avgConductance, Scalar<java.lang.Double> minConductance)
Partition conductance assesses the quality of many partitions in a graph<ID> Scalar<java.lang.Double>
partitionModularity(PgxGraph graph, Partition<ID> partition)
Modularity summarizes information about the quality of components in a graph<ID> Scalar<java.lang.Double>
partitionModularity(PgxGraph graph, Partition<ID> partition, Scalar<java.lang.Double> modularity)
Modularity summarizes information about the quality of components in a graph<ID> PgxFuture<Scalar<java.lang.Double>>
partitionModularityAsync(PgxGraph graph, Partition<ID> partition)
Modularity summarizes information about the quality of components in a graph<ID> PgxFuture<Scalar<java.lang.Double>>
partitionModularityAsync(PgxGraph graph, Partition<ID> partition, java.lang.String modularityName)
<ID> PgxFuture<Scalar<java.lang.Double>>
partitionModularityAsync(PgxGraph graph, Partition<ID> partition, Scalar<java.lang.Double> modularity)
Modularity summarizes information about the quality of components in a graph<ID> VertexSet<ID>
periphery(PgxGraph graph)
Periphery/center gives an overview of the extreme distances and the corresponding vertices in a graph<ID> VertexSet<ID>
periphery(PgxGraph graph, VertexSet<ID> periphery)
Periphery/center gives an overview of the extreme distances and the corresponding vertices in a graph<ID> PgxFuture<VertexSet<ID>>
peripheryAsync(PgxGraph graph)
Periphery/center gives an overview of the extreme distances and the corresponding vertices in a graph<ID> PgxFuture<VertexSet<ID>>
peripheryAsync(PgxGraph graph, VertexSet<ID> periphery)
Periphery/center gives an overview of the extreme distances and the corresponding vertices in a graph<ID> VertexProperty<ID,java.lang.Double>
personalizedPagerank(PgxGraph graph, ID vertexId, java.math.BigDecimal e, java.math.BigDecimal d, int max)
Convenience wrapper around {@link #personalizedPagerank(PgxGraph, PgxVertex, BigDecimal, BigDecimal, int,)} taking a vertex ID instead of aPgxVertex
.<ID> VertexProperty<ID,java.lang.Double>
personalizedPagerank(PgxGraph graph, ID vertexId, java.math.BigDecimal e, java.math.BigDecimal d, int max, boolean norm)
Convenience wrapper aroundpersonalizedPagerank(PgxGraph, PgxVertex, BigDecimal, BigDecimal, int, boolean)
taking a vertex ID instead of aPgxVertex
.<ID> VertexProperty<ID,java.lang.Double>
personalizedPagerank(PgxGraph graph, ID vertexId, java.math.BigDecimal e, java.math.BigDecimal d, int max, boolean norm, VertexProperty<ID,java.lang.Double> rank)
Convenience wrapper around#personalizedPagerank(PgxGraph, PgxVertex, BigDecimal, BigDecimal, int, boolean, VertexProperty<ID, Double>)
taking a vertex ID instead of aPgxVertex
.<ID> VertexProperty<ID,java.lang.Double>
personalizedPagerank(PgxGraph graph, ID vertexId, java.math.BigDecimal e, java.math.BigDecimal d, int max, VertexProperty<ID,java.lang.Double> rank)
Convenience wrapper around#personalizedPagerank(PgxGraph, PgxVertex, BigDecimal, BigDecimal, int, VertexProperty<ID, Double>)
taking a vertex ID instead of aPgxVertex
.<ID> VertexProperty<ID,java.lang.Double>
personalizedPagerank(PgxGraph graph, PgxVertex<ID> v)
Personalized PageRank for a vertex of interest.<ID> VertexProperty<ID,java.lang.Double>
personalizedPagerank(PgxGraph graph, PgxVertex<ID> v, boolean norm)
Personalized PageRank for a vertex of interest.<ID> VertexProperty<ID,java.lang.Double>
personalizedPagerank(PgxGraph graph, PgxVertex<ID> v, boolean norm, VertexProperty<ID,java.lang.Double> rank)
Personalized PageRank for a vertex of interest.<ID> VertexProperty<ID,java.lang.Double>
personalizedPagerank(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max)
Personalized PageRank for a vertex of interest.<ID> VertexProperty<ID,java.lang.Double>
personalizedPagerank(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max, boolean norm)
Personalized PageRank for a vertex of interest.<ID> VertexProperty<ID,java.lang.Double>
personalizedPagerank(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max, boolean norm, VertexProperty<ID,java.lang.Double> rank)
Personalized PageRank for a vertex of interest.<ID> VertexProperty<ID,java.lang.Double>
personalizedPagerank(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max, VertexProperty<ID,java.lang.Double> rank)
Personalized PageRank for a vertex of interest.<ID> VertexProperty<ID,java.lang.Double>
personalizedPagerank(PgxGraph graph, PgxVertex<ID> v, VertexProperty<ID,java.lang.Double> rank)
Personalized PageRank for a vertex of interest.<ID> VertexProperty<ID,java.lang.Double>
personalizedPagerank(PgxGraph graph, VertexSet<ID> vertices)
Personalized PageRank for a set of vertices of interest.<ID> VertexProperty<ID,java.lang.Double>
personalizedPagerank(PgxGraph graph, VertexSet<ID> vertices, boolean norm)
Personalized PageRank for a set of vertices of interest.<ID> VertexProperty<ID,java.lang.Double>
personalizedPagerank(PgxGraph graph, VertexSet<ID> vertices, boolean norm, VertexProperty<ID,java.lang.Double> rank)
Personalized PageRank for a set of vertices of interest.<ID> VertexProperty<ID,java.lang.Double>
personalizedPagerank(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max)
Personalized PageRank for a set of vertices of interest.<ID> VertexProperty<ID,java.lang.Double>
personalizedPagerank(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max, boolean norm)
Personalized PageRank for a set of vertices of interest.<ID> VertexProperty<ID,java.lang.Double>
personalizedPagerank(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max, boolean norm, VertexProperty<ID,java.lang.Double> rank)
Personalized PageRank for a set of vertices of interest.<ID> VertexProperty<ID,java.lang.Double>
personalizedPagerank(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max, VertexProperty<ID,java.lang.Double> rank)
Personalized PageRank for a set of vertices of interest.<ID> VertexProperty<ID,java.lang.Double>
personalizedPagerank(PgxGraph graph, VertexSet<ID> vertices, VertexProperty<ID,java.lang.Double> rank)
Personalized PageRank for a set of vertices of interest.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedPagerankAsync(PgxGraph graph, PgxVertex<ID> v)
Personalized PageRank for a vertex of interest.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, boolean norm)
Personalized PageRank for a vertex of interest.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, boolean norm, VertexProperty<ID,java.lang.Double> rank)
Personalized PageRank for a vertex of interest.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max)
Personalized PageRank for a vertex of interest.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max, boolean norm)
Personalized PageRank for a vertex of interest.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max, boolean norm, VertexProperty<ID,java.lang.Double> rank)
Personalized PageRank for a vertex of interest.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max, VertexProperty<ID,java.lang.Double> rank)
Personalized PageRank for a vertex of interest.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, VertexProperty<ID,java.lang.Double> rank)
Personalized PageRank for a vertex of interest.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices)
Personalized PageRank for a set of vertices of interest.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, boolean norm)
Personalized PageRank for a set of vertices of interest.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, boolean norm, VertexProperty<ID,java.lang.Double> rank)
Personalized PageRank for a set of vertices of interest.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max)
Personalized PageRank for a set of vertices of interest.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max, boolean norm)
Personalized PageRank for a set of vertices of interest.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max, boolean norm, VertexProperty<ID,java.lang.Double> rank)
Personalized PageRank for a set of vertices of interest.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max, VertexProperty<ID,java.lang.Double> rank)
Personalized PageRank for a set of vertices of interest.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, VertexProperty<ID,java.lang.Double> rank)
Personalized PageRank for a set of vertices of interest.<ID> VertexProperty<ID,java.lang.Double>
personalizedSalsa(BipartiteGraph graph, ID v, java.math.BigDecimal d, int maxIterations, java.math.BigDecimal maxDiff)
Convenience wrapper aroundpersonalizedSalsa(BipartiteGraph, PgxVertex, BigDecimal, int, BigDecimal)
taking a vertex ID instead ofPgxVertex
.<ID> VertexProperty<ID,java.lang.Double>
personalizedSalsa(BipartiteGraph graph, ID v, java.math.BigDecimal d, int maxIterations, java.math.BigDecimal maxDiff, VertexProperty<ID,java.lang.Double> salsaRank)
Convenience wrapper around#personalizedSalsa(BipartiteGraph, PgxVertex, BigDecimal, int, BigDecimal, VertexProperty<ID, Double>)
taking a vertex ID instead ofPgxVertex
.<ID> VertexProperty<ID,java.lang.Double>
personalizedSalsa(BipartiteGraph graph, PgxVertex<ID> v)
Personalized salsa for a vertex of interest.<ID> VertexProperty<ID,java.lang.Double>
personalizedSalsa(BipartiteGraph graph, PgxVertex<ID> v, double d, int maxIter, double maxDiff)
Personalized salsa for a vertex of interest.<ID> VertexProperty<ID,java.lang.Double>
personalizedSalsa(BipartiteGraph graph, PgxVertex<ID> v, double d, int maxIter, double maxDiff, VertexProperty<ID,java.lang.Double> salsaRank)
Personalized salsa for a vertex of interest.<ID> VertexProperty<ID,java.lang.Double>
personalizedSalsa(BipartiteGraph graph, PgxVertex<ID> v, VertexProperty<ID,java.lang.Double> salsaRank)
Personalized salsa for a vertex of interest.<ID> VertexProperty<ID,java.lang.Double>
personalizedSalsa(BipartiteGraph graph, VertexSet<ID> vertices)
Personalized salsa for a set of vertices of interest.<ID> VertexProperty<ID,java.lang.Double>
personalizedSalsa(BipartiteGraph graph, VertexSet<ID> vertices, double d, int maxIter, double maxDiff)
Personalized salsa for a set of vertices of interest.<ID> VertexProperty<ID,java.lang.Double>
personalizedSalsa(BipartiteGraph graph, VertexSet<ID> vertices, double d, int maxIter, double maxDiff, VertexProperty<ID,java.lang.Double> salsaRank)
Personalized salsa for a set of vertices of interest.<ID> VertexProperty<ID,java.lang.Double>
personalizedSalsa(BipartiteGraph graph, VertexSet<ID> vertices, VertexProperty<ID,java.lang.Double> salsaRank)
Personalized salsa for a set of vertices of interest.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedSalsaAsync(BipartiteGraph graph, PgxVertex<ID> v)
Personalized salsa for a vertex of interest.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedSalsaAsync(BipartiteGraph graph, PgxVertex<ID> v, double d, int maxIter, double maxDiff)
Personalized salsa for a vertex of interest.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedSalsaAsync(BipartiteGraph graph, PgxVertex<ID> v, double d, int maxIter, double maxDiff, VertexProperty<ID,java.lang.Double> salsaRank)
Personalized salsa for a vertex of interest.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedSalsaAsync(BipartiteGraph graph, PgxVertex<ID> v, VertexProperty<ID,java.lang.Double> salsaRank)
Personalized salsa for a vertex of interest.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedSalsaAsync(BipartiteGraph graph, VertexSet<ID> vertices)
Personalized salsa for a set of vertices of interest.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedSalsaAsync(BipartiteGraph graph, VertexSet<ID> vertices, double d, int maxIter, double maxDiff)
Personalized salsa for a set of vertices of interest.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedSalsaAsync(BipartiteGraph graph, VertexSet<ID> vertices, double d, int maxIter, double maxDiff, VertexProperty<ID,java.lang.Double> salsaRank)
Personalized salsa for a set of vertices of interest.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedSalsaAsync(BipartiteGraph graph, VertexSet<ID> vertices, VertexProperty<ID,java.lang.Double> salsaRank)
Personalized salsa for a set of vertices of interest.<ID> VertexProperty<ID,java.lang.Double>
personalizedWeightedPagerank(PgxGraph graph, ID vertexId, java.math.BigDecimal e, java.math.BigDecimal d, int max, boolean norm, EdgeProperty<java.lang.Double> weight)
Convenience wrapper aroundpersonalizedWeightedPagerank(PgxGraph, PgxVertex, BigDecimal, BigDecimal, int, boolean, EdgeProperty)
taking a vertex ID instead of aPgxVertex
.<ID> VertexProperty<ID,java.lang.Double>
personalizedWeightedPagerank(PgxGraph graph, ID vertexId, java.math.BigDecimal e, java.math.BigDecimal d, int max, boolean norm, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
Convenience wrapper around#personalizedWeightedPagerank(PgxGraph, PgxVertex, BigDecimal, BigDecimal, int, boolean, EdgeProperty, VertexProperty<ID, Double>)
taking a vertex ID instead of aPgxVertex
.<ID> VertexProperty<ID,java.lang.Double>
personalizedWeightedPagerank(PgxGraph graph, ID vertexId, java.math.BigDecimal e, java.math.BigDecimal d, int max, EdgeProperty<java.lang.Double> weight)
Convenience wrapper aroundpersonalizedWeightedPagerank(PgxGraph, PgxVertex, BigDecimal, BigDecimal, int, EdgeProperty)
taking a vertex ID instead of aPgxVertex
.<ID> VertexProperty<ID,java.lang.Double>
personalizedWeightedPagerank(PgxGraph graph, ID vertexId, java.math.BigDecimal e, java.math.BigDecimal d, int max, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
Convenience wrapper around#personalizedWeightedPagerank(PgxGraph, PgxVertex, BigDecimal, BigDecimal, int, EdgeProperty, VertexProperty<ID, Double>)
taking a vertex ID instead of aPgxVertex
.<ID> VertexProperty<ID,java.lang.Double>
personalizedWeightedPagerank(PgxGraph graph, PgxVertex<ID> v, boolean norm, EdgeProperty<java.lang.Double> weight)
Personalized weighted pagerank for a vertex and weighted edges.<ID> VertexProperty<ID,java.lang.Double>
personalizedWeightedPagerank(PgxGraph graph, PgxVertex<ID> v, boolean norm, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
Personalized weighted pagerank for a vertex and weighted edges.<ID> VertexProperty<ID,java.lang.Double>
personalizedWeightedPagerank(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max, boolean norm, EdgeProperty<java.lang.Double> weight)
Personalized weighted pagerank for a vertex and weighted edges.<ID> VertexProperty<ID,java.lang.Double>
personalizedWeightedPagerank(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max, boolean norm, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
Personalized weighted pagerank for a vertex and weighted edges.<ID> VertexProperty<ID,java.lang.Double>
personalizedWeightedPagerank(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max, EdgeProperty<java.lang.Double> weight)
Personalized weighted pagerank for a vertex and weighted edges.<ID> VertexProperty<ID,java.lang.Double>
personalizedWeightedPagerank(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
Personalized weighted pagerank for a vertex and weighted edges.<ID> VertexProperty<ID,java.lang.Double>
personalizedWeightedPagerank(PgxGraph graph, PgxVertex<ID> v, EdgeProperty<java.lang.Double> weight)
Personalized weighted pagerank for a vertex and weighted edges.<ID> VertexProperty<ID,java.lang.Double>
personalizedWeightedPagerank(PgxGraph graph, PgxVertex<ID> v, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
Personalized weighted pagerank for a vertex and weighted edges.<ID> VertexProperty<ID,java.lang.Double>
personalizedWeightedPagerank(PgxGraph graph, VertexSet<ID> vertices, boolean norm, EdgeProperty<java.lang.Double> weight)
Personalized pagerank for a set of vertices and weighted edges.<ID> VertexProperty<ID,java.lang.Double>
personalizedWeightedPagerank(PgxGraph graph, VertexSet<ID> vertices, boolean norm, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
Personalized pagerank for a set of vertices and weighted edges.<ID> VertexProperty<ID,java.lang.Double>
personalizedWeightedPagerank(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max, boolean norm, EdgeProperty<java.lang.Double> weight)
Personalized pagerank for a set of vertices and weighted edges.<ID> VertexProperty<ID,java.lang.Double>
personalizedWeightedPagerank(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max, boolean norm, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
Personalized pagerank for a set of vertices and weighted edges.<ID> VertexProperty<ID,java.lang.Double>
personalizedWeightedPagerank(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max, EdgeProperty<java.lang.Double> weight)
Personalized pagerank for a set of vertices and weighted edges.<ID> VertexProperty<ID,java.lang.Double>
personalizedWeightedPagerank(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
Personalized pagerank for a set of vertices and weighted edges.<ID> VertexProperty<ID,java.lang.Double>
personalizedWeightedPagerank(PgxGraph graph, VertexSet<ID> vertices, EdgeProperty<java.lang.Double> weight)
Personalized pagerank for a set of vertices and weighted edges.<ID> VertexProperty<ID,java.lang.Double>
personalizedWeightedPagerank(PgxGraph graph, VertexSet<ID> vertices, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
Personalized pagerank for a set of vertices and weighted edges.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedWeightedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, boolean norm, EdgeProperty<java.lang.Double> weight)
Personalized weighted pagerank for a vertex and weighted edges.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedWeightedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, boolean norm, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
Personalized weighted pagerank for a vertex and weighted edges.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedWeightedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max, boolean norm, EdgeProperty<java.lang.Double> weight)
Personalized weighted pagerank for a vertex and weighted edges.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedWeightedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max, boolean norm, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
Personalized weighted pagerank for a vertex and weighted edges.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedWeightedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max, EdgeProperty<java.lang.Double> weight)
Personalized weighted pagerank for a vertex and weighted edges.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedWeightedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
Personalized weighted pagerank for a vertex and weighted edges.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedWeightedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, EdgeProperty<java.lang.Double> weight)
Personalized weighted pagerank for a vertex and weighted edges.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedWeightedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
Personalized weighted pagerank for a vertex and weighted edges.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedWeightedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, boolean norm, EdgeProperty<java.lang.Double> weight)
Personalized pagerank for a set of vertices and weighted edges.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedWeightedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, boolean norm, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
Personalized pagerank for a set of vertices and weighted edges.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedWeightedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max, boolean norm, EdgeProperty<java.lang.Double> weight)
Personalized pagerank for a set of vertices and weighted edges.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedWeightedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max, boolean norm, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
Personalized pagerank for a set of vertices and weighted edges.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedWeightedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max, EdgeProperty<java.lang.Double> weight)
Personalized pagerank for a set of vertices and weighted edges.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedWeightedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
Personalized pagerank for a set of vertices and weighted edges.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedWeightedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, EdgeProperty<java.lang.Double> weight)
Personalized pagerank for a set of vertices and weighted edges.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
personalizedWeightedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
Personalized pagerank for a set of vertices and weighted edges.Pg2vecModelBuilder
pg2vecModelBuilder()
Builds a pg2vec modelEdgeProperty<java.lang.Boolean>
prim(PgxGraph graph, EdgeProperty<java.lang.Double> weight)
prim reveals tree structures with shortest paths in a graphEdgeProperty<java.lang.Boolean>
prim(PgxGraph graph, EdgeProperty<java.lang.Double> weight, java.lang.String mstName)
Convenience wrapper aroundprim(PgxGraph, EdgeProperty, String)
EdgeProperty<java.lang.Boolean>
prim(PgxGraph graph, EdgeProperty<java.lang.Double> weight, EdgeProperty<java.lang.Boolean> mst)
prim reveals tree structures with shortest paths in a graphPgxFuture<EdgeProperty<java.lang.Boolean>>
primAsync(PgxGraph graph, EdgeProperty<java.lang.Double> weight)
prim reveals tree structures with shortest paths in a graphPgxFuture<EdgeProperty<java.lang.Boolean>>
primAsync(PgxGraph graph, EdgeProperty<java.lang.Double> weight, EdgeProperty<java.lang.Boolean> mst)
prim reveals tree structures with shortest paths in a graph<ID> Pair<Scalar<java.lang.Integer>,VertexProperty<ID,java.lang.Integer>>
radius(PgxGraph graph)
Diameter/radius gives an overview of the distances in a graph<ID> Pair<Scalar<java.lang.Integer>,VertexProperty<ID,java.lang.Integer>>
radius(PgxGraph graph, Scalar<java.lang.Integer> radius, VertexProperty<ID,java.lang.Integer> eccentricity)
Diameter/radius gives an overview of the distances in a graph<ID> PgxFuture<Pair<Scalar<java.lang.Integer>,VertexProperty<ID,java.lang.Integer>>>
radiusAsync(PgxGraph graph)
Diameter/radius gives an overview of the distances in a graph<ID> PgxFuture<Pair<Scalar<java.lang.Integer>,VertexProperty<ID,java.lang.Integer>>>
radiusAsync(PgxGraph graph, Scalar<java.lang.Integer> radius, VertexProperty<ID,java.lang.Integer> eccentricity)
Diameter/radius gives an overview of the distances in a graph<ID> PgxMap<PgxVertex<ID>,java.lang.Integer>
randomWalkWithRestart(PgxGraph graph, ID source, int length, java.math.BigDecimal resetProb, PgxMap<PgxVertex<ID>,java.lang.Integer> visitCount)
Convenience wrapper aroundrandomWalkWithRestart(PgxGraph, PgxVertex, int, double, PgxMap)
taking a vertex ID instead of aPgxVertex
.<ID> PgxMap<PgxVertex<ID>,java.lang.Integer>
randomWalkWithRestart(PgxGraph graph, PgxVertex<ID> source, int length, double resetProb, PgxMap<PgxVertex<ID>,java.lang.Integer> visitCount)
random walk with restart does the what its name says, it can find approximate stationary distributions<ID> PgxFuture<PgxMap<PgxVertex<ID>,java.lang.Integer>>
randomWalkWithRestartAsync(PgxGraph graph, PgxVertex<ID> source, int length, double resetProb, PgxMap<PgxVertex<ID>,java.lang.Integer> visitCount)
random walk with restart does the what its name says, it can find approximate stationary distributions<ID> java.lang.Integer
reachability(PgxGraph graph, PgxVertex<ID> source, PgxVertex<ID> dest, int maxHops, boolean ignoreEdgeDirection)
Reachability is a fast way to check if two vertices are reachable from each other.<ID> PgxFuture<java.lang.Integer>
reachabilityAsync(PgxGraph graph, PgxVertex<ID> source, PgxVertex<ID> dest, int maxHops, boolean ignoreEdgeDirection)
Reachability is a fast way to check if two vertices are reachable from each other.<ID> VertexProperty<ID,java.lang.Double>
salsa(BipartiteGraph graph)
SALSA computes ranking scores.<ID> VertexProperty<ID,java.lang.Double>
salsa(BipartiteGraph graph, double maxDiff, int maxIter)
SALSA computes ranking scores.<ID> VertexProperty<ID,java.lang.Double>
salsa(BipartiteGraph graph, double maxDiff, int maxIter, VertexProperty<ID,java.lang.Double> salsaRank)
SALSA computes ranking scores.<ID> VertexProperty<ID,java.lang.Double>
salsa(BipartiteGraph graph, VertexProperty<ID,java.lang.Double> salsaRank)
SALSA computes ranking scores.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
salsaAsync(BipartiteGraph graph)
SALSA computes ranking scores.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
salsaAsync(BipartiteGraph graph, double maxDiff, int maxIter)
SALSA computes ranking scores.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
salsaAsync(BipartiteGraph graph, double maxDiff, int maxIter, VertexProperty<ID,java.lang.Double> salsaRank)
SALSA computes ranking scores.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
salsaAsync(BipartiteGraph graph, VertexProperty<ID,java.lang.Double> salsaRank)
SALSA computes ranking scores.<ID> Partition<ID>
sccKosaraju(PgxGraph graph)
Kosaraju finds strongly connected components in a graph<ID> Partition<ID>
sccKosaraju(PgxGraph graph, VertexProperty<ID,java.lang.Long> partitionDistribution)
Kosaraju finds strongly connected components in a graph<ID> PgxFuture<Partition<ID>>
sccKosarajuAsync(PgxGraph graph)
Kosaraju finds strongly connected components in a graph<ID> PgxFuture<Partition<ID>>
sccKosarajuAsync(PgxGraph graph, VertexProperty<ID,java.lang.Long> partitionDistribution)
Kosaraju finds strongly connected components in a graph<ID> Partition<ID>
sccTarjan(PgxGraph graph)
Tarjan finds strongly connected components in a graph<ID> Partition<ID>
sccTarjan(PgxGraph graph, VertexProperty<ID,java.lang.Long> partitionDistribution)
Tarjan finds strongly connected components in a graph<ID> PgxFuture<Partition<ID>>
sccTarjanAsync(PgxGraph graph)
Tarjan finds strongly connected components in a graph<ID> PgxFuture<Partition<ID>>
sccTarjanAsync(PgxGraph graph, VertexProperty<ID,java.lang.Long> partitonDistribution)
Tarjan finds strongly connected components in a graph<ID> AllPaths<ID>
shortestPathBellmanFord(PgxGraph graph, ID srcId, EdgeProperty<java.lang.Double> cost)
Convenience wrapper aroundshortestPathBellmanFord(PgxGraph, PgxVertex, EdgeProperty)
taking a vertex ID instead ofPgxVertex
.<ID> AllPaths<ID>
shortestPathBellmanFord(PgxGraph graph, ID srcId, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Convenience wrapper aroundshortestPathBellmanFord(PgxGraph, PgxVertex, EdgeProperty, VertexProperty, VertexProperty, VertexProperty)
taking a vertex ID instead ofPgxVertex
.<ID> AllPaths<ID>
shortestPathBellmanFord(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost)
Bellman-ford finds multiple shortest paths at the same time<ID> AllPaths<ID>
shortestPathBellmanFord(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost, boolean ignoreEdgeDirection)
Bellman-ford finds multiple shortest paths at the same time<ID> AllPaths<ID>
shortestPathBellmanFord(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Bellman-ford finds multiple shortest paths at the same time<ID> AllPaths<ID>
shortestPathBellmanFord(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge, boolean ignoreEdgeDirection)
Bellman-ford finds multiple shortest paths at the same time<ID> PgxFuture<AllPaths<ID>>
shortestPathBellmanFordAsync(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost)
Bellman-ford finds multiple shortest paths at the same time<ID> PgxFuture<AllPaths<ID>>
shortestPathBellmanFordAsync(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost, boolean ignoreEdgeDirection)
Bellman-ford finds multiple shortest paths at the same time<ID> PgxFuture<AllPaths<ID>>
shortestPathBellmanFordAsync(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Bellman-ford finds multiple shortest paths at the same time<ID> PgxFuture<AllPaths<ID>>
shortestPathBellmanFordAsync(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge, boolean ignoreEdgeDirection)
Bellman-ford finds multiple shortest paths at the same time<ID> AllPaths<ID>
shortestPathBellmanFordReverse(PgxGraph graph, ID srcId, EdgeProperty<java.lang.Double> cost)
Convenience wrapper aroundshortestPathBellmanFordReverse(PgxGraph, PgxVertex, EdgeProperty)
taking a vertex ID instead ofPgxVertex
.<ID> AllPaths<ID>
shortestPathBellmanFordReverse(PgxGraph graph, ID srcId, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Convenience wrapper aroundshortestPathBellmanFordReverse(PgxGraph, PgxVertex, EdgeProperty, VertexProperty, VertexProperty, VertexProperty)
taking a vertex ID instead ofPgxVertex
.<ID> AllPaths<ID>
shortestPathBellmanFordReverse(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost)
Reversed bellman-ford finds multiple shortest paths at the same time<ID> AllPaths<ID>
shortestPathBellmanFordReverse(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Reversed bellman-ford finds multiple shortest paths at the same time<ID> PgxFuture<AllPaths<ID>>
shortestPathBellmanFordReverseAsync(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost)
Reversed bellman-ford finds multiple shortest paths at the same time<ID> PgxFuture<AllPaths<ID>>
shortestPathBellmanFordReverseAsync(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Reversed bellman-ford finds multiple shortest paths at the same time<ID> PgxPath<ID>
shortestPathDijkstra(PgxGraph graph, ID srcId, ID dstId, EdgeProperty<java.lang.Double> cost)
Convenience wrapper aroundshortestPathDijkstra(PgxGraph, PgxVertex, PgxVertex, EdgeProperty)
taking vertex IDs instead ofPgxVertex
.<ID> PgxPath<ID>
shortestPathDijkstra(PgxGraph graph, ID srcId, ID dstId, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Convenience wrapper aroundshortestPathDijkstra(PgxGraph, PgxVertex, PgxVertex, EdgeProperty)
taking vertex IDs instead ofPgxVertex
.<ID> PgxPath<ID>
shortestPathDijkstra(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost)
Dijkstra is a fast algorithm for finding a shortest path in a graph<ID> PgxPath<ID>
shortestPathDijkstra(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, boolean ignoreEdgeDirection)
Undirected Dijkstra's algorithm is a variant of Dijkstra's algorithm that ignores edge directions.<ID> PgxPath<ID>
shortestPathDijkstra(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Dijkstra is a fast algorithm for finding a shortest path in a graph<ID> PgxPath<ID>
shortestPathDijkstra(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge, boolean ignoreEdgeDirection)
Undirected Dijkstra's algorithm is a variant of Dijkstra's algorithm that ignores edge directions.<ID> PgxFuture<PgxPath<ID>>
shortestPathDijkstraAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost)
Dijkstra is a fast algorithm for finding a shortest path in a graph<ID> PgxFuture<PgxPath<ID>>
shortestPathDijkstraAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, boolean ignoreEdgeDirection)
Undirected Dijkstra's algorithm is a variant of Dijkstra's algorithm that ignores edge directions.<ID> PgxFuture<PgxPath<ID>>
shortestPathDijkstraAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Dijkstra is a fast algorithm for finding a shortest path in a graph<ID> PgxFuture<PgxPath<ID>>
shortestPathDijkstraAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge, boolean ignoreEdgeDirection)
Undirected Dijkstra's algorithm is a variant of Dijkstra's algorithm that ignores edge directions.<ID> PgxPath<ID>
shortestPathDijkstraBidirectional(PgxGraph graph, ID srcId, ID dstId, EdgeProperty<java.lang.Double> cost)
Convenience wrapper aroundshortestPathDijkstraBidirectional(PgxGraph, PgxVertex, PgxVertex, EdgeProperty)
taking vertex IDs instead ofPgxVertex
.<ID> PgxPath<ID>
shortestPathDijkstraBidirectional(PgxGraph graph, ID srcId, ID dstId, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Convenience wrapper aroundshortestPathDijkstraBidirectional(PgxGraph, PgxVertex, PgxVertex, EdgeProperty)
taking vertex IDs instead ofPgxVertex
.<ID> PgxPath<ID>
shortestPathDijkstraBidirectional(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost)
Bidirectional dijkstra is a fast algorithm for finding a shortest path in a graph<ID> PgxPath<ID>
shortestPathDijkstraBidirectional(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, boolean ignoreEdgeDirection)
Undirected bidirectional dijkstra is a variant of bidirectional dijkstra that ignores edge directions<ID> PgxPath<ID>
shortestPathDijkstraBidirectional(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Bidirectional dijkstra is a fast algorithm for finding a shortest path in a graph<ID> PgxPath<ID>
shortestPathDijkstraBidirectional(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge, boolean ignoreEdgeDirection)
Undirected bidirectional dijkstra is a variant of bidirectional dijkstra that ignores edge directions<ID> PgxFuture<PgxPath<ID>>
shortestPathDijkstraBidirectionalAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost)
Bidirectional dijkstra is a fast algorithm for finding a shortest path in a graph<ID> PgxFuture<PgxPath<ID>>
shortestPathDijkstraBidirectionalAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, boolean ignoreEdgeDirection)
Undirected bidirectional dijkstra is a variant of bidirectional dijkstra that ignores edge directions<ID> PgxFuture<PgxPath<ID>>
shortestPathDijkstraBidirectionalAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, java.lang.String parentName, java.lang.String parentEdgeName)
<ID> PgxFuture<PgxPath<ID>>
shortestPathDijkstraBidirectionalAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, java.lang.String parentName, java.lang.String parentEdgeName, boolean ignoreEdgeDirection)
<ID> PgxFuture<PgxPath<ID>>
shortestPathDijkstraBidirectionalAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Bidirectional dijkstra is a fast algorithm for finding a shortest path in a graph<ID> PgxFuture<PgxPath<ID>>
shortestPathDijkstraBidirectionalAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge, boolean ignoreEdgeDirection)
Undirected bidirectional dijkstra is a variant of bidirectional dijkstra that ignores edge directions<ID> PgxPath<ID>
shortestPathFilteredDijkstra(PgxGraph graph, ID srcId, ID dstId, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr)
Convenience wrapper aroundshortestPathFilteredDijkstra(PgxGraph, PgxVertex, PgxVertex, EdgeProperty, GraphFilter)
taking vertex IDs instead ofPgxVertex
.<ID> PgxPath<ID>
shortestPathFilteredDijkstra(PgxGraph graph, ID srcId, ID dstId, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Convenience wrapper aroundshortestPathFilteredDijkstra(PgxGraph, PgxVertex, PgxVertex, EdgeProperty, GraphFilter)
taking vertex IDs instead ofPgxVertex
.<ID> PgxPath<ID>
shortestPathFilteredDijkstra(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr)
Filtered Dijkstra is a fast algorithm for finding a shortest path while also filtering edges<ID> PgxPath<ID>
shortestPathFilteredDijkstra(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, boolean ignoreEdgeDirection)
Undirected filtered djkstra is variation of the filtered djkstra's algorithm that ignores edge directions.<ID> PgxPath<ID>
shortestPathFilteredDijkstra(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Filtered Dijkstra is a fast algorithm for finding a shortest path while also filtering edges<ID> PgxPath<ID>
shortestPathFilteredDijkstra(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge, boolean ignoreEdgeDirection)
Undirected filtered djkstra is variation of the filtered djkstra's algorithm that ignores edge directions.<ID> PgxFuture<PgxPath<ID>>
shortestPathFilteredDijkstraAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr)
Filtered Dijkstra is a fast algorithm for finding a shortest path while also filtering edges<ID> PgxFuture<PgxPath<ID>>
shortestPathFilteredDijkstraAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, boolean ignoreEdgeDirection)
Undirected filtered djkstra is variation of the filtered djkstra's algorithm that ignores edge directions.<ID> PgxFuture<PgxPath<ID>>
shortestPathFilteredDijkstraAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Filtered Dijkstra is a fast algorithm for finding a shortest path while also filtering edges<ID> PgxFuture<PgxPath<ID>>
shortestPathFilteredDijkstraAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge, boolean ignoreEdgeDirection)
Undirected filtered djkstra is variation of the filtered djkstra's algorithm that ignores edge directions.<ID> PgxPath<ID>
shortestPathFilteredDijkstraBidirectional(PgxGraph graph, ID srcId, ID dstId, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr)
Convenience wrapper aroundshortestPathFilteredDijkstraBidirectional(PgxGraph, PgxVertex, PgxVertex, EdgeProperty, GraphFilter)
taking vertex IDs instead ofPgxVertex
.<ID> PgxPath<ID>
shortestPathFilteredDijkstraBidirectional(PgxGraph graph, ID srcId, ID dstId, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Convenience wrapper aroundshortestPathFilteredDijkstraBidirectional(PgxGraph, PgxVertex, PgxVertex, EdgeProperty, GraphFilter)
taking vertex IDs instead ofPgxVertex
.<ID> PgxPath<ID>
shortestPathFilteredDijkstraBidirectional(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr)
Bidirectional dijkstra is a fast algorithm for finding a shortest path while also filtering edges<ID> PgxPath<ID>
shortestPathFilteredDijkstraBidirectional(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, boolean ignoreEdgeDirection)
Bidirectional dijkstra is a fast algorithm for finding a shortest path while also filtering edges<ID> PgxPath<ID>
shortestPathFilteredDijkstraBidirectional(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Bidirectional dijkstra is a fast algorithm for finding a shortest path while also filtering edges<ID> PgxPath<ID>
shortestPathFilteredDijkstraBidirectional(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge, boolean ignoreEdgeDirection)
Bidirectional dijkstra is a fast algorithm for finding a shortest path while also filtering edges<ID> PgxFuture<PgxPath<ID>>
shortestPathFilteredDijkstraBidirectionalAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr)
Bidirectional dijkstra is a fast algorithm for finding a shortest path while also filtering edges<ID> PgxFuture<PgxPath<ID>>
shortestPathFilteredDijkstraBidirectionalAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, boolean ignoreEdgeDirection)
Bidirectional dijkstra is a fast algorithm for finding a shortest path while also filtering edges<ID> PgxFuture<PgxPath<ID>>
shortestPathFilteredDijkstraBidirectionalAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, java.lang.String parentName, java.lang.String parentEdgeName)
<ID> PgxFuture<PgxPath<ID>>
shortestPathFilteredDijkstraBidirectionalAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, java.lang.String parentName, java.lang.String parentEdgeName, boolean ignoreEdgeDirection)
<ID> PgxFuture<PgxPath<ID>>
shortestPathFilteredDijkstraBidirectionalAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Bidirectional dijkstra is a fast algorithm for finding a shortest path while also filtering edges<ID> PgxFuture<PgxPath<ID>>
shortestPathFilteredDijkstraBidirectionalAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge, boolean ignoreEdgeDirection)
Bidirectional dijkstra is a fast algorithm for finding a shortest path while also filtering edges<ID> AllPaths<ID>
shortestPathHopDist(PgxGraph graph, ID srcId)
Convenience wrapper aroundshortestPathHopDist(PgxGraph, PgxVertex)
taking a vertex ID instead ofPgxVertex
.<ID> AllPaths<ID>
shortestPathHopDist(PgxGraph graph, ID srcId, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Convenience wrapper aroundshortestPathHopDist(PgxGraph, PgxVertex, VertexProperty, VertexProperty, VertexProperty)
taking a vertex ID instead ofPgxVertex
.<ID> AllPaths<ID>
shortestPathHopDist(PgxGraph graph, PgxVertex<ID> src)
Hop distance can give a relatively fast insight on the distances in a graph<ID> AllPaths<ID>
shortestPathHopDist(PgxGraph graph, PgxVertex<ID> src, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Hop distance can give a relatively fast insight on the distances in a graph<ID> PgxFuture<AllPaths<ID>>
shortestPathHopDistAsync(PgxGraph graph, PgxVertex<ID> src)
Hop distance can give a relatively fast insight on the distances in a graph<ID> PgxFuture<AllPaths<ID>>
shortestPathHopDistAsync(PgxGraph graph, PgxVertex<ID> src, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Hop distance can give a relatively fast insight on the distances in a graph<ID> AllPaths<ID>
shortestPathHopDistReverse(PgxGraph graph, ID srcId)
Convenience wrapper aroundshortestPathHopDistReverse(PgxGraph, PgxVertex)
taking a vertex ID instead ofPgxVertex
.<ID> AllPaths<ID>
shortestPathHopDistReverse(PgxGraph graph, ID srcId, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Convenience wrapper aroundshortestPathHopDistReverse(PgxGraph, PgxVertex, VertexProperty, VertexProperty, VertexProperty)
taking a vertex ID instead ofPgxVertex
.<ID> AllPaths<ID>
shortestPathHopDistReverse(PgxGraph graph, PgxVertex<ID> src)
Backwards hop distance can give a relatively fast insight on the distances in a graph<ID> AllPaths<ID>
shortestPathHopDistReverse(PgxGraph graph, PgxVertex<ID> src, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Backwards hop distance can give a relatively fast insight on the distances in a graph<ID> PgxFuture<AllPaths<ID>>
shortestPathHopDistReverseAsync(PgxGraph graph, PgxVertex<ID> src)
Backwards hop distance can give a relatively fast insight on the distances in a graph<ID> PgxFuture<AllPaths<ID>>
shortestPathHopDistReverseAsync(PgxGraph graph, PgxVertex<ID> src, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Backwards hop distance can give a relatively fast insight on the distances in a graph<ID> AllPaths<ID>
shortestPathHopDistUndirected(PgxGraph graph, PgxVertex<ID> src)
Undirected hop distance can give a relatively fast insight on the distances in a graph<ID> AllPaths<ID>
shortestPathHopDistUndirected(PgxGraph graph, PgxVertex<ID> src, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Undirected hop distance can give a relatively fast insight on the distances in a graph<ID> PgxFuture<AllPaths<ID>>
shortestPathHopDistUndirectedAsync(PgxGraph graph, PgxVertex<ID> src)
Undirected hop distance can give a relatively fast insight on the distances in a graph<ID> PgxFuture<AllPaths<ID>>
shortestPathHopDistUndirectedAsync(PgxGraph graph, PgxVertex<ID> src, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Undirected hop distance can give a relatively fast insight on the distances in a graph<ID> AllPaths<ID>
shortestPathMultiDestinationDijkstra(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost)
Dijkstra is a fast algorithm for finding a shortest path in a graph and goes to all destinations.<ID> AllPaths<ID>
shortestPathMultiDestinationDijkstra(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Dijkstra is a fast algorithm for finding a shortest path in a graph and goes to all destinations.<ID> PgxFuture<AllPaths<ID>>
shortestPathMultiDestinationDijkstraAsync(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost)
Dijkstra is a fast algorithm for finding a shortest path in a graph and goes to all destinations.<ID> PgxFuture<AllPaths<ID>>
shortestPathMultiDestinationDijkstraAsync(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Dijkstra is a fast algorithm for finding a shortest path in a graph and goes to all destinations.<ID> VertexProperty<ID,java.lang.String>
speakerListenerLabelPropagation(PgxGraph graph, java.lang.String labelsPropName)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.<ID> VertexProperty<ID,java.lang.String>
speakerListenerLabelPropagation(PgxGraph graph, java.lang.String labelsPropName, int maxIter, double threshold, java.lang.String delimiter)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.<ID> VertexProperty<ID,java.lang.String>
speakerListenerLabelPropagation(PgxGraph graph, VertexProperty<ID,java.lang.String> labels, int maxIter, double threshold, java.lang.String delimiter)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.<ID> PgxFuture<VertexProperty<ID,java.lang.String>>
speakerListenerLabelPropagationAsync(PgxGraph graph, java.lang.String labelsPropName)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.<ID> PgxFuture<VertexProperty<ID,java.lang.String>>
speakerListenerLabelPropagationAsync(PgxGraph graph, java.lang.String labelsPropName, int maxIter, double threshold, java.lang.String delimiter)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.<ID> PgxFuture<VertexProperty<ID,java.lang.String>>
speakerListenerLabelPropagationAsync(PgxGraph graph, VertexProperty<ID,java.lang.String> labels, int maxIter, double threshold, java.lang.String delimiter)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.SupervisedEdgeWiseModelBuilder
supervisedEdgeWiseModelBuilder()
Return a SupervisedEdgeWise model builder that can be used to set the configuration of the model and then create it.SupervisedGraphWiseModelBuilder
supervisedGraphWiseModelBuilder()
Return a SupervisedGraphWise model builder that can be used to set the configuration of the model and then create it.<ID> VertexProperty<ID,java.lang.Integer>
topologicalSchedule(PgxGraph graph, VertexSet<ID> source)
Topological schedule gives an order of visit for the reachable vertices from the source<ID> VertexProperty<ID,java.lang.Integer>
topologicalSchedule(PgxGraph graph, VertexSet<ID> source, VertexProperty<ID,java.lang.Integer> topoSched)
Topological sort gives an order of visit for vertices in directed acyclic graphs<ID> PgxFuture<VertexProperty<ID,java.lang.Integer>>
topologicalScheduleAsync(PgxGraph graph, VertexSet<ID> source)
Topological schedule gives an order of visit for the reachable vertices from the source<ID> PgxFuture<VertexProperty<ID,java.lang.Integer>>
topologicalScheduleAsync(PgxGraph graph, VertexSet<ID> source, VertexProperty<ID,java.lang.Integer> topoSched)
Topological schedule gives an order of visit for the reachable vertices from the source<ID> VertexProperty<ID,java.lang.Integer>
topologicalSort(PgxGraph graph)
Topological sort gives an order of visit for vertices in directed acyclic graphs<ID> VertexProperty<ID,java.lang.Integer>
topologicalSort(PgxGraph graph, VertexProperty<ID,java.lang.Integer> topoSort)
Topological sort gives an order of visit for vertices in directed acyclic graphs<ID> PgxFuture<VertexProperty<ID,java.lang.Integer>>
topologicalSortAsync(PgxGraph graph)
Topological sort gives an order of visit for vertices in directed acyclic graphs<ID> PgxFuture<VertexProperty<ID,java.lang.Integer>>
topologicalSortAsync(PgxGraph graph, VertexProperty<ID,java.lang.Integer> topoSort)
Topological sort gives an order of visit for vertices in directed acyclic graphsjava.lang.String
toString()
UnsupervisedAnomalyDetectionGraphWiseModelBuilder
unsupervisedAnomalyDetectionGraphWiseModelBuilder()
Return a UnsupervisedAnomalyDetectionGraphWiseModel model builder that can be used to set the configuration of the model and then create it.UnsupervisedEdgeWiseModelBuilder
unsupervisedEdgeWiseModelBuilder()
Return a UnsupervisedEdgeWise model builder that can be used to set the configuration of the model and then create it.UnsupervisedGraphWiseModelBuilder
unsupervisedGraphWiseModelBuilder()
Return a UnsupervisedGraphWise model builder that can be used to set the configuration of the model and then create it.<ID> VertexProperty<ID,java.lang.Double>
vertexBetweennessCentrality(PgxGraph graph)
Betweenness centrality measures the centrality of the vertices to identify important vertices for the flow of information<ID> VertexProperty<ID,java.lang.Double>
vertexBetweennessCentrality(PgxGraph graph, VertexProperty<ID,java.lang.Double> bc)
Betweenness centrality measures the centrality of the vertices to identify important vertices for the flow of information<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
vertexBetweennessCentralityAsync(PgxGraph graph)
Betweenness centrality measures the centrality of the vertices to identify important vertices for the flow of information<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
vertexBetweennessCentralityAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> bc)
Betweenness centrality measures the centrality of the vertices to identify important vertices for the flow of information<ID> Partition<ID>
wcc(PgxGraph graph)
Identifying weakly connected components can be useful for clustering graph data<ID> Partition<ID>
wcc(PgxGraph graph, VertexProperty<ID,java.lang.Long> partitionDistribution)
Identifying weakly connected components can be useful for clustering graph data<ID> PgxFuture<Partition<ID>>
wccAsync(PgxGraph graph)
Identifying weakly connected components can be useful for clustering graph data<ID> PgxFuture<Partition<ID>>
wccAsync(PgxGraph graph, java.lang.String partitonDistributionName)
<ID> PgxFuture<Partition<ID>>
wccAsync(PgxGraph graph, VertexProperty<ID,java.lang.Long> partitionDistribution)
Identifying weakly connected components can be useful for clustering graph data<ID> VertexProperty<ID,java.lang.Double>
weightedPagerank(PgxGraph graph, boolean norm, EdgeProperty<java.lang.Double> weight)
PageRank on weighted edges.<ID> VertexProperty<ID,java.lang.Double>
weightedPagerank(PgxGraph graph, boolean norm, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
PageRank on weighted edges.<ID> VertexProperty<ID,java.lang.Double>
weightedPagerank(PgxGraph graph, double e, double d, int max, boolean norm, EdgeProperty<java.lang.Double> weight)
PageRank on weighted edges.<ID> VertexProperty<ID,java.lang.Double>
weightedPagerank(PgxGraph graph, double e, double d, int max, boolean norm, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
PageRank on weighted edges.<ID> VertexProperty<ID,java.lang.Double>
weightedPagerank(PgxGraph graph, double e, double d, int max, EdgeProperty<java.lang.Double> weight)
PageRank on weighted edges.<ID> VertexProperty<ID,java.lang.Double>
weightedPagerank(PgxGraph graph, double e, double d, int max, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
PageRank on weighted edges.<ID> VertexProperty<ID,java.lang.Double>
weightedPagerank(PgxGraph graph, EdgeProperty<java.lang.Double> weight)
PageRank on weighted edges.<ID> VertexProperty<ID,java.lang.Double>
weightedPagerank(PgxGraph graph, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
PageRank on weighted edges.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
weightedPagerankAsync(PgxGraph graph, boolean norm, EdgeProperty<java.lang.Double> weight)
PageRank on weighted edges.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
weightedPagerankAsync(PgxGraph graph, boolean norm, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
PageRank on weighted edges.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
weightedPagerankAsync(PgxGraph graph, double e, double d, int max, boolean norm, EdgeProperty<java.lang.Double> weight)
PageRank on weighted edges.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
weightedPagerankAsync(PgxGraph graph, double e, double d, int max, boolean norm, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
PageRank on weighted edges.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
weightedPagerankAsync(PgxGraph graph, double e, double d, int max, EdgeProperty<java.lang.Double> weight)
PageRank on weighted edges.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
weightedPagerankAsync(PgxGraph graph, double e, double d, int max, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
PageRank on weighted edges.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
weightedPagerankAsync(PgxGraph graph, EdgeProperty<java.lang.Double> weight)
PageRank on weighted edges.<ID> PgxFuture<VertexProperty<ID,java.lang.Double>>
weightedPagerankAsync(PgxGraph graph, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
PageRank on weighted edges.<ID> VertexProperty<ID,java.lang.String>
weightedSpeakerListenerLabelPropagation(PgxGraph graph, java.lang.String labelsPropName, int maxIter, double threshold, java.lang.String delimiter, EdgeProperty<java.lang.Double> weight)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.<ID> VertexProperty<ID,java.lang.String>
weightedSpeakerListenerLabelPropagation(PgxGraph graph, java.lang.String labelsPropName, EdgeProperty<java.lang.Double> weight)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.<ID> VertexProperty<ID,java.lang.String>
weightedSpeakerListenerLabelPropagation(PgxGraph graph, VertexProperty<ID,java.lang.String> labels, int maxIter, double threshold, java.lang.String delimiter, EdgeProperty<java.lang.Double> weight)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.<ID> PgxFuture<VertexProperty<ID,java.lang.String>>
weightedSpeakerListenerLabelPropagationAsync(PgxGraph graph, java.lang.String labelsPropName, int maxIter, double threshold, java.lang.String delimiter, EdgeProperty<java.lang.Double> weight)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.<ID> PgxFuture<VertexProperty<ID,java.lang.String>>
weightedSpeakerListenerLabelPropagationAsync(PgxGraph graph, java.lang.String labelsPropName, EdgeProperty<java.lang.Double> weight)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.<ID> PgxFuture<VertexProperty<ID,java.lang.String>>
weightedSpeakerListenerLabelPropagationAsync(PgxGraph graph, VertexProperty<ID,java.lang.String> labels, int maxIter, double threshold, java.lang.String delimiter, EdgeProperty<java.lang.Double> weight)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.<ID> Pair<VertexSequence<ID>,VertexSequence<ID>>
whomToFollow(PgxGraph graph, ID vertexId, int topK)
Convenience wrapper aroundwhomToFollow(PgxGraph, PgxVertex, int)
taking a vertex ID instead of aPgxVertex
.<ID> Pair<VertexSequence<ID>,VertexSequence<ID>>
whomToFollow(PgxGraph graph, ID vertexId, int topK, int sizeCircleOfTrust)
Convenience wrapper aroundwhomToFollow(PgxGraph, PgxVertex, int, int)
taking a vertex ID instead of aPgxVertex
.<ID> Pair<VertexSequence<ID>,VertexSequence<ID>>
whomToFollow(PgxGraph graph, ID vertexId, int topK, int sizeCircleOfTrust, int maxIter, java.math.BigDecimal tol, java.math.BigDecimal dampingFactor, int salsaMaxIter, java.math.BigDecimal salsaTol)
Convenience wrapper aroundwhomToFollow(PgxGraph, PgxVertex, int, int, int, BigDecimal, BigDecimal, int, BigDecimal)
taking a vertex ID instead of aPgxVertex
.<ID> Pair<VertexSequence<ID>,VertexSequence<ID>>
whomToFollow(PgxGraph graph, ID vertexId, int topK, int sizeCircleOfTrust, int maxIter, java.math.BigDecimal tol, java.math.BigDecimal dampingFactor, int salsaMaxIter, java.math.BigDecimal salsaTol, VertexSequence<ID> hubs, VertexSequence<ID> authorities)
Convenience wrapper aroundwhomToFollow(PgxGraph, PgxVertex, int, int, int, BigDecimal, BigDecimal, int, BigDecimal, VertexSequence, VertexSequence)
taking a vertex ID instead of aPgxVertex
.<ID> Pair<VertexSequence<ID>,VertexSequence<ID>>
whomToFollow(PgxGraph graph, PgxVertex<ID> vertex)
WTF is a recommendation algorithm.<ID> Pair<VertexSequence<ID>,VertexSequence<ID>>
whomToFollow(PgxGraph graph, PgxVertex<ID> vertex, int topK)
WTF is a recommendation algorithm.<ID> Pair<VertexSequence<ID>,VertexSequence<ID>>
whomToFollow(PgxGraph graph, PgxVertex<ID> vertex, int topK, int sizeCircleOfTrust)
WTF is a recommendation algorithm.<ID> Pair<VertexSequence<ID>,VertexSequence<ID>>
whomToFollow(PgxGraph graph, PgxVertex<ID> vertex, int topK, int sizeCircleOfTrust, int maxIter, double tol, double dampingFactor, int salsaMaxIter, double salsaTol)
WTF is a recommendation algorithm.<ID> Pair<VertexSequence<ID>,VertexSequence<ID>>
whomToFollow(PgxGraph graph, PgxVertex<ID> vertex, int topK, int sizeCircleOfTrust, int maxIter, double tol, double dampingFactor, int salsaMaxIter, double salsaTol, VertexSequence<ID> hubs, VertexSequence<ID> authorities)
WTF is a recommendation algorithm.<ID> Pair<VertexSequence<ID>,VertexSequence<ID>>
whomToFollow(PgxGraph graph, PgxVertex<ID> vertex, int topK, int sizeCircleOfTrust, VertexSequence<ID> hubs, VertexSequence<ID> authorities)
WTF is a recommendation algorithm.<ID> Pair<VertexSequence<ID>,VertexSequence<ID>>
whomToFollow(PgxGraph graph, PgxVertex<ID> vertex, int topK, VertexSequence<ID> hubs, VertexSequence<ID> authorities)
WTF is a recommendation algorithm.<ID> Pair<VertexSequence<ID>,VertexSequence<ID>>
whomToFollow(PgxGraph graph, PgxVertex<ID> vertex, VertexSequence<ID> hubs, VertexSequence<ID> authorities)
WTF is a recommendation algorithm.<ID> PgxFuture<Pair<VertexSequence<ID>,VertexSequence<ID>>>
whomToFollowAsync(PgxGraph graph, PgxVertex<ID> vertex)
WTF is a recommendation algorithm.<ID> PgxFuture<Pair<VertexSequence<ID>,VertexSequence<ID>>>
whomToFollowAsync(PgxGraph graph, PgxVertex<ID> vertex, int topK)
WTF is a recommendation algorithm.<ID> PgxFuture<Pair<VertexSequence<ID>,VertexSequence<ID>>>
whomToFollowAsync(PgxGraph graph, PgxVertex<ID> vertex, int topK, int sizeCircleOfTrust)
WTF is a recommendation algorithm.<ID> PgxFuture<Pair<VertexSequence<ID>,VertexSequence<ID>>>
whomToFollowAsync(PgxGraph graph, PgxVertex<ID> vertex, int topK, int sizeCircleOfTrust, int maxIter, double tol, double dampingFactor, int salsaMaxIter, double salsaTol)
WTF is a recommendation algorithm.<ID> PgxFuture<Pair<VertexSequence<ID>,VertexSequence<ID>>>
whomToFollowAsync(PgxGraph graph, PgxVertex<ID> vertex, int topK, int sizeCircleOfTrust, int maxIter, double tol, double dampingFactor, int salsaMaxIter, double salsaTol, VertexSequence<ID> hubs, VertexSequence<ID> authorities)
WTF is a recommendation algorithm.<ID> PgxFuture<Pair<VertexSequence<ID>,VertexSequence<ID>>>
whomToFollowAsync(PgxGraph graph, PgxVertex<ID> vertex, int topK, int sizeCircleOfTrust, VertexSequence<ID> hubs, VertexSequence<ID> authorities)
WTF is a recommendation algorithm.<ID> PgxFuture<Pair<VertexSequence<ID>,VertexSequence<ID>>>
whomToFollowAsync(PgxGraph graph, PgxVertex<ID> vertex, int topK, VertexSequence<ID> hubs, VertexSequence<ID> authorities)
WTF is a recommendation algorithm.<ID> PgxFuture<Pair<VertexSequence<ID>,VertexSequence<ID>>>
whomToFollowAsync(PgxGraph graph, PgxVertex<ID> vertex, VertexSequence<ID> hubs, VertexSequence<ID> authorities)
WTF is a recommendation algorithm.-
Methods inherited from class oracle.pgx.api.Destroyable
close, destroy
-
-
-
-
Method Detail
-
getSession
public PgxSession getSession()
Gets the session.- Returns:
- the PGX session
-
loadPg2vecModel
public Pg2vecModel loadPg2vecModel(java.lang.String path, java.lang.String key) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
Loads an encrypted pg2vec model- Parameters:
path
- the pathkey
- the decryption key, or null if no encryption was used- Returns:
- the loaded model
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
-
loadPg2vecModel
public GenericModelLoader<Pg2vecModel> loadPg2vecModel()
ReturnsGenericModelLoader
to configure how to load a Pg2vec model and then trigger it.- Returns:
- a
GenericModelLoader
to configure how to load a Pg2vec model - Since:
- 21.1
-
pg2vecModelBuilder
public Pg2vecModelBuilder pg2vecModelBuilder()
Builds a pg2vec model- Returns:
-
loadDeepWalkModel
public DeepWalkModel loadDeepWalkModel(java.lang.String path, java.lang.String key) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
Loads an encrypted Deepwalk model- Parameters:
path
- the pathkey
- the decryption key, or null if no encryption was used- Returns:
- the loaded model
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
-
loadDeepWalkModel
public GenericModelLoader<DeepWalkModel> loadDeepWalkModel()
ReturnsGenericModelLoader
to configure how to load a DeepWalk model and then trigger it.- Returns:
- a
GenericModelLoader
to configure how to load a DeepWalk model - Since:
- 21.1
-
modelRepository
public GenericModelRepositoryBuilder modelRepository()
Builder for model repository.- Returns:
- the builder
- Since:
- 22.2
-
deepWalkModelBuilder
public DeepWalkModelBuilder deepWalkModelBuilder()
Builder for Deepwalk model- Returns:
- the builder
-
loadSupervisedGraphWiseModel
public SupervisedGraphWiseModel loadSupervisedGraphWiseModel(java.lang.String path, java.lang.String key) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
Loads an encrypted SupervisedGraphWise model- Parameters:
path
- the pathkey
- the decryption key, or null if no encryption was used- Returns:
- the loaded model
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
-
loadSupervisedGraphWiseModel
public GenericModelLoader<SupervisedGraphWiseModel> loadSupervisedGraphWiseModel()
ReturnsGenericModelLoader
to configure how to load a SupervisedGraphWiseModel model and then trigger it.- Returns:
- a
GenericModelLoader
to configure how to load a SupervisedGraphWiseModel model - Since:
- 21.1
-
supervisedGraphWiseModelBuilder
public SupervisedGraphWiseModelBuilder supervisedGraphWiseModelBuilder()
Return a SupervisedGraphWise model builder that can be used to set the configuration of the model and then create it.- Returns:
- the builder
-
graphWiseConvLayerConfigBuilder
public GraphWiseConvLayerConfigBuilder graphWiseConvLayerConfigBuilder()
Return a GraphWiseConvLayerConfigBuilder used to create a GraphWiseConvLayerConfig- Returns:
- the builder
-
graphWiseAttentionLayerConfigBuilder
public GraphWiseAttentionLayerConfigBuilder graphWiseAttentionLayerConfigBuilder()
Return a GraphWiseAttentionLayerConfigBuilder used to create a GraphWiseAttentionLayerConfig- Returns:
- the builder
-
graphWiseValidationConfigBuilder
public GraphWiseValidationConfigBuilder graphWiseValidationConfigBuilder()
Return a GraphWiseValidationConfigBuilder used to create a GraphWiseValidationConfig- Returns:
- the builder
-
graphWiseDgiLayerConfigBuilder
public GraphWiseDgiLayerConfigBuilder graphWiseDgiLayerConfigBuilder()
Return a GraphWiseDgiLayerConfigBuilder used to create a GraphWiseDgiLayerConfig- Returns:
- the builder
-
graphWiseDominantLayerConfigBuilder
public GraphWiseDominantLayerConfigBuilder graphWiseDominantLayerConfigBuilder()
Return a GraphWiseDominantLayerConfigBuilder used to create a GraphWiseDominantLayerConfig- Returns:
- the builder
-
graphWisePredictionLayerConfigBuilder
public GraphWisePredictionLayerConfigBuilder graphWisePredictionLayerConfigBuilder()
Return a GraphWisePredictionLayerConfigBuilder used to create a GraphWiseLayerConfig- Returns:
- the builder
-
categoricalPropertyConfigBuilder
public CategoricalPropertyConfigBuilder categoricalPropertyConfigBuilder(java.lang.String featureName)
Return a CategoricalPropertyConfigBuilder used to create a CategoricalPropertyConfig- Returns:
- the builder
-
continuousPropertyConfigBuilder
public ContinuousPropertyConfigBuilder continuousPropertyConfigBuilder(java.lang.String featureName)
Return a ContinuousPropertyConfigBuilder used to create a ContinuousPropertyConfig- Returns:
- the builder
-
loadSupervisedEdgeWiseModel
public SupervisedEdgeWiseModel loadSupervisedEdgeWiseModel(java.lang.String path, java.lang.String key) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
Loads an encrypted SupervisedEdgeWise model- Parameters:
path
- the pathkey
- the decryption key, or null if no encryption was used- Returns:
- the loaded model
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
-
loadUnsupervisedEdgeWiseModel
public UnsupervisedEdgeWiseModel loadUnsupervisedEdgeWiseModel(java.lang.String path, java.lang.String key) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
Loads an encrypted UnsupervisedEdgeWise model- Parameters:
path
- the pathkey
- the decryption key, or null if no encryption was used- Returns:
- the loaded model
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
-
loadSupervisedEdgeWiseModel
public GenericModelLoader<SupervisedEdgeWiseModel> loadSupervisedEdgeWiseModel()
ReturnsGenericModelLoader
to configure how to load a SupervisedEdgeWiseModel model and then trigger it.- Returns:
- a
GenericModelLoader
to configure how to load a SupervisedEdgeWiseModel model - Since:
- 23.1
-
loadUnsupervisedEdgeWiseModel
public GenericModelLoader<UnsupervisedEdgeWiseModel> loadUnsupervisedEdgeWiseModel()
ReturnsGenericModelLoader
to configure how to load a UnsupervisedEdgeWiseModel model and then trigger it.- Returns:
- a
GenericModelLoader
to configure how to load a UnsupervisedEdgeWiseModel model - Since:
- 23.2
-
supervisedEdgeWiseModelBuilder
public SupervisedEdgeWiseModelBuilder supervisedEdgeWiseModelBuilder()
Return a SupervisedEdgeWise model builder that can be used to set the configuration of the model and then create it.- Returns:
- the builder
-
unsupervisedEdgeWiseModelBuilder
public UnsupervisedEdgeWiseModelBuilder unsupervisedEdgeWiseModelBuilder()
Return a UnsupervisedEdgeWise model builder that can be used to set the configuration of the model and then create it.- Returns:
- the builder
-
loadUnsupervisedGraphWiseModel
public UnsupervisedGraphWiseModel loadUnsupervisedGraphWiseModel(java.lang.String path, java.lang.String key) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
Loads an encrypted UnsupervisedGraphWise model- Parameters:
path
- the pathkey
- the decryption key, or null if no encryption was used- Returns:
- the loaded model
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
-
loadUnsupervisedGraphWiseModel
public GenericModelLoader<UnsupervisedGraphWiseModel> loadUnsupervisedGraphWiseModel()
ReturnsGenericModelLoader
to configure how to load a UnsupervisedGraphWise model and then trigger it.- Returns:
- a
GenericModelLoader
to configure how to load a UnsupervisedGraphWise model - Since:
- 21.2
-
loadUnsupervisedAnomalyDetectionGraphWiseModel
public GenericModelLoader<UnsupervisedAnomalyDetectionGraphWiseModel> loadUnsupervisedAnomalyDetectionGraphWiseModel()
ReturnsGenericModelLoader
to configure how to load a UnsupervisedAnomalyDetectionGraphWise model and then trigger it.- Returns:
- a
GenericModelLoader
to configure how to load a UnsupervisedAnomalyDetectionGraphWise model - Since:
- 23.2
-
unsupervisedGraphWiseModelBuilder
public UnsupervisedGraphWiseModelBuilder unsupervisedGraphWiseModelBuilder()
Return a UnsupervisedGraphWise model builder that can be used to set the configuration of the model and then create it.- Returns:
- the builder
-
unsupervisedAnomalyDetectionGraphWiseModelBuilder
public UnsupervisedAnomalyDetectionGraphWiseModelBuilder unsupervisedAnomalyDetectionGraphWiseModelBuilder()
Return a UnsupervisedAnomalyDetectionGraphWiseModel model builder that can be used to set the configuration of the model and then create it.- Returns:
- the builder
-
pagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> pagerankAsync(PgxGraph graph)
PageRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
PageRank is an algorithm that computes ranking scores for the vertices using the network created by the incoming edges in the graph. Thus it is intended for directed graphs, although undirected graphs can be treated as well by converting them into directed graphs with reciprocated edges (i.e. keeping the original edge and creating a second one going in the opposite direction). The edges on the graph will define the relevance of each vertex in the graph, reflecting this on the scores, meaning that greater scores will correspond to vertices with greater relevance.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
- max_iter: 100
Applications
- PageRank can be used to measure the relative importance of documents which are linked together, such as the World Wide Web. The computed rank represents a probability distribution of the likelihood that a person randomly clicking on links will arrive at any particular page.
- Parameters:
graph
- the graph.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxFuture<VertexProperty<Integer, Double>> promise = analyst.pagerankAsync(graph); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
pagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> pagerankAsync(PgxGraph graph, boolean norm)
PageRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
PageRank is an algorithm that computes ranking scores for the vertices using the network created by the incoming edges in the graph. Thus it is intended for directed graphs, although undirected graphs can be treated as well by converting them into directed graphs with reciprocated edges (i.e. keeping the original edge and creating a second one going in the opposite direction). The edges on the graph will define the relevance of each vertex in the graph, reflecting this on the scores, meaning that greater scores will correspond to vertices with greater relevance.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
- max_iter: 100
Applications
- PageRank can be used to measure the relative importance of documents which are linked together, such as the World Wide Web. The computed rank represents a probability distribution of the likelihood that a person randomly clicking on links will arrive at any particular page.
- Parameters:
graph
- the graph.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxFuture<VertexProperty<Integer, Double>> promise = analyst.pagerankAsync(graph, false); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
pagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> pagerankAsync(PgxGraph graph, double e, double d, int max)
PageRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
PageRank is an algorithm that computes ranking scores for the vertices using the network created by the incoming edges in the graph. Thus it is intended for directed graphs, although undirected graphs can be treated as well by converting them into directed graphs with reciprocated edges (i.e. keeping the original edge and creating a second one going in the opposite direction). The edges on the graph will define the relevance of each vertex in the graph, reflecting this on the scores, meaning that greater scores will correspond to vertices with greater relevance.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
- max_iter: 100
Applications
- PageRank can be used to measure the relative importance of documents which are linked together, such as the World Wide Web. The computed rank represents a probability distribution of the likelihood that a person randomly clicking on links will arrive at any particular page.
- Parameters:
graph
- the graph.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxFuture<VertexProperty<Integer, Double>> promise = analyst.pagerankAsync(graph, 0.001, 0.85, 100); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
pagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> pagerankAsync(PgxGraph graph, double e, double d, int max, boolean norm)
PageRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
PageRank is an algorithm that computes ranking scores for the vertices using the network created by the incoming edges in the graph. Thus it is intended for directed graphs, although undirected graphs can be treated as well by converting them into directed graphs with reciprocated edges (i.e. keeping the original edge and creating a second one going in the opposite direction). The edges on the graph will define the relevance of each vertex in the graph, reflecting this on the scores, meaning that greater scores will correspond to vertices with greater relevance.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
- max_iter: 100
Applications
- PageRank can be used to measure the relative importance of documents which are linked together, such as the World Wide Web. The computed rank represents a probability distribution of the likelihood that a person randomly clicking on links will arrive at any particular page.
- Parameters:
graph
- the graph.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxFuture<VertexProperty<Integer, Double>> promise = analyst.pagerankAsync(graph, 0.001, 0.85, 100, false); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
pagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> pagerankAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> rank)
PageRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
PageRank is an algorithm that computes ranking scores for the vertices using the network created by the incoming edges in the graph. Thus it is intended for directed graphs, although undirected graphs can be treated as well by converting them into directed graphs with reciprocated edges (i.e. keeping the original edge and creating a second one going in the opposite direction). The edges on the graph will define the relevance of each vertex in the graph, reflecting this on the scores, meaning that greater scores will correspond to vertices with greater relevance.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
- max_iter: 100
Applications
- PageRank can be used to measure the relative importance of documents which are linked together, such as the World Wide Web. The computed rank represents a probability distribution of the likelihood that a person randomly clicking on links will arrive at any particular page.
- Parameters:
graph
- the graph.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.pagerankAsync(graph, rank); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
pagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> pagerankAsync(PgxGraph graph, boolean norm, VertexProperty<ID,java.lang.Double> rank)
PageRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
PageRank is an algorithm that computes ranking scores for the vertices using the network created by the incoming edges in the graph. Thus it is intended for directed graphs, although undirected graphs can be treated as well by converting them into directed graphs with reciprocated edges (i.e. keeping the original edge and creating a second one going in the opposite direction). The edges on the graph will define the relevance of each vertex in the graph, reflecting this on the scores, meaning that greater scores will correspond to vertices with greater relevance.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
- max_iter: 100
Applications
- PageRank can be used to measure the relative importance of documents which are linked together, such as the World Wide Web. The computed rank represents a probability distribution of the likelihood that a person randomly clicking on links will arrive at any particular page.
- Parameters:
graph
- the graph.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.pagerankAsync(graph, false, rank); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
pagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> pagerankAsync(PgxGraph graph, double e, double d, int max, VertexProperty<ID,java.lang.Double> rank)
PageRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
PageRank is an algorithm that computes ranking scores for the vertices using the network created by the incoming edges in the graph. Thus it is intended for directed graphs, although undirected graphs can be treated as well by converting them into directed graphs with reciprocated edges (i.e. keeping the original edge and creating a second one going in the opposite direction). The edges on the graph will define the relevance of each vertex in the graph, reflecting this on the scores, meaning that greater scores will correspond to vertices with greater relevance.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
- max_iter: 100
Applications
- PageRank can be used to measure the relative importance of documents which are linked together, such as the World Wide Web. The computed rank represents a probability distribution of the likelihood that a person randomly clicking on links will arrive at any particular page.
- Parameters:
graph
- the graph.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.pagerankAsync(graph, 0.001, 0.85, 100, rank); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
pagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> pagerankAsync(PgxGraph graph, double e, double d, int max, boolean norm, VertexProperty<ID,java.lang.Double> rank)
PageRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
PageRank is an algorithm that computes ranking scores for the vertices using the network created by the incoming edges in the graph. Thus it is intended for directed graphs, although undirected graphs can be treated as well by converting them into directed graphs with reciprocated edges (i.e. keeping the original edge and creating a second one going in the opposite direction). The edges on the graph will define the relevance of each vertex in the graph, reflecting this on the scores, meaning that greater scores will correspond to vertices with greater relevance.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
- max_iter: 100
Applications
- PageRank can be used to measure the relative importance of documents which are linked together, such as the World Wide Web. The computed rank represents a probability distribution of the likelihood that a person randomly clicking on links will arrive at any particular page.
- Parameters:
graph
- the graph.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.pagerankAsync(graph, 0.001, 0.85, 100, false, rank); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
pagerankApproximateAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> pagerankApproximateAsync(PgxGraph graph)
Faster, but less accurate than pagerank. It compares and spots out important vertices in a graph
Definition
This variant of the PageRank algorithm computes the ranking scores for the vertices in similar way to the classic algorithm without normalization and with a more relaxed convergence criteria, since the tolerated error value is compared against each single vertex in the graph, instead of looking at the cumulative vertex error. Thus this variant will converge faster than the classic algorithm, but the ranking values might not be as accurate as in the classic implementation.
Implementation Details
The implementation of this algorithm uses an iterative method. The ranking values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- PageRank can be used to measure the relative importance of documents which are linked together, such as the World Wide Web. The computed rank represents a probability distribution of the likelihood that a person randomly clicking on links will arrive at any particular page.
- Parameters:
graph
- the graph.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxFuture<VertexProperty<Integer, Double>> promise = analyst.pagerankApproximateAsync(graph); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
pagerankApproximateAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> pagerankApproximateAsync(PgxGraph graph, double e, double d, int max)
Faster, but less accurate than pagerank. It compares and spots out important vertices in a graph
Definition
This variant of the PageRank algorithm computes the ranking scores for the vertices in similar way to the classic algorithm without normalization and with a more relaxed convergence criteria, since the tolerated error value is compared against each single vertex in the graph, instead of looking at the cumulative vertex error. Thus this variant will converge faster than the classic algorithm, but the ranking values might not be as accurate as in the classic implementation.
Implementation Details
The implementation of this algorithm uses an iterative method. The ranking values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- PageRank can be used to measure the relative importance of documents which are linked together, such as the World Wide Web. The computed rank represents a probability distribution of the likelihood that a person randomly clicking on links will arrive at any particular page.
- Parameters:
graph
- the graph.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxFuture<VertexProperty<Integer, Double>> promise = analyst.pagerankApproximateAsync(graph, 0.001, 0.85, 100); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
pagerankApproximateAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> pagerankApproximateAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> rank)
Faster, but less accurate than pagerank. It compares and spots out important vertices in a graph
Definition
This variant of the PageRank algorithm computes the ranking scores for the vertices in similar way to the classic algorithm without normalization and with a more relaxed convergence criteria, since the tolerated error value is compared against each single vertex in the graph, instead of looking at the cumulative vertex error. Thus this variant will converge faster than the classic algorithm, but the ranking values might not be as accurate as in the classic implementation.
Implementation Details
The implementation of this algorithm uses an iterative method. The ranking values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- PageRank can be used to measure the relative importance of documents which are linked together, such as the World Wide Web. The computed rank represents a probability distribution of the likelihood that a person randomly clicking on links will arrive at any particular page.
- Parameters:
graph
- the graph.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.pagerankApproximateAsync(graph, rank); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
pagerankApproximateAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> pagerankApproximateAsync(PgxGraph graph, double e, double d, int max, VertexProperty<ID,java.lang.Double> rank)
Faster, but less accurate than pagerank. It compares and spots out important vertices in a graph
Definition
This variant of the PageRank algorithm computes the ranking scores for the vertices in similar way to the classic algorithm without normalization and with a more relaxed convergence criteria, since the tolerated error value is compared against each single vertex in the graph, instead of looking at the cumulative vertex error. Thus this variant will converge faster than the classic algorithm, but the ranking values might not be as accurate as in the classic implementation.
Implementation Details
The implementation of this algorithm uses an iterative method. The ranking values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- PageRank can be used to measure the relative importance of documents which are linked together, such as the World Wide Web. The computed rank represents a probability distribution of the likelihood that a person randomly clicking on links will arrive at any particular page.
- Parameters:
graph
- the graph.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.pagerankApproximateAsync( graph, 0.001, 0.85, 100, rank); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
weightedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> weightedPagerankAsync(PgxGraph graph, EdgeProperty<java.lang.Double> weight)
PageRank on weighted edges. It compares and spots out important vertices in a graph
Definition
The Weighted PageRank works like the original PageRank algorithm, except that it allows for a weight value assigned to each edge. This weight determines the fraction of the PageRank score that will flow from the source vertex through the current edge to its destination vertex.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It extends the scope of the PageRank applications by allowing edges with non-uniform weights, which can reflect better the structures underlying in graphs.
- Parameters:
graph
- the graph.weight
- edge property holding the weight of each edge in the graph.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.weightedPagerankAsync(graph, cost); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
weightedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> weightedPagerankAsync(PgxGraph graph, boolean norm, EdgeProperty<java.lang.Double> weight)
PageRank on weighted edges. It compares and spots out important vertices in a graph
Definition
The Weighted PageRank works like the original PageRank algorithm, except that it allows for a weight value assigned to each edge. This weight determines the fraction of the PageRank score that will flow from the source vertex through the current edge to its destination vertex.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It extends the scope of the PageRank applications by allowing edges with non-uniform weights, which can reflect better the structures underlying in graphs.
- Parameters:
graph
- the graph.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.weight
- edge property holding the weight of each edge in the graph.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.weightedPagerankAsync(graph, false, cost); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
weightedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> weightedPagerankAsync(PgxGraph graph, double e, double d, int max, EdgeProperty<java.lang.Double> weight)
PageRank on weighted edges. It compares and spots out important vertices in a graph
Definition
The Weighted PageRank works like the original PageRank algorithm, except that it allows for a weight value assigned to each edge. This weight determines the fraction of the PageRank score that will flow from the source vertex through the current edge to its destination vertex.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It extends the scope of the PageRank applications by allowing edges with non-uniform weights, which can reflect better the structures underlying in graphs.
- Parameters:
graph
- the graph.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.weight
- edge property holding the weight of each edge in the graph.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.weightedPagerankAsync(graph, 0.001, 0.85, 100, cost); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
weightedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> weightedPagerankAsync(PgxGraph graph, double e, double d, int max, boolean norm, EdgeProperty<java.lang.Double> weight)
PageRank on weighted edges. It compares and spots out important vertices in a graph
Definition
The Weighted PageRank works like the original PageRank algorithm, except that it allows for a weight value assigned to each edge. This weight determines the fraction of the PageRank score that will flow from the source vertex through the current edge to its destination vertex.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It extends the scope of the PageRank applications by allowing edges with non-uniform weights, which can reflect better the structures underlying in graphs.
- Parameters:
graph
- the graph.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.weight
- edge property holding the weight of each edge in the graph.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.weightedPagerankAsync( graph, 0.001, 0.85, 100, false, cost); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
weightedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> weightedPagerankAsync(PgxGraph graph, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
PageRank on weighted edges. It compares and spots out important vertices in a graph
Definition
The Weighted PageRank works like the original PageRank algorithm, except that it allows for a weight value assigned to each edge. This weight determines the fraction of the PageRank score that will flow from the source vertex through the current edge to its destination vertex.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It extends the scope of the PageRank applications by allowing edges with non-uniform weights, which can reflect better the structures underlying in graphs.
- Parameters:
graph
- the graph.weight
- edge property holding the weight of each edge in the graph.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.weightedPagerankAsync(graph, cost, rank); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
weightedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> weightedPagerankAsync(PgxGraph graph, boolean norm, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
PageRank on weighted edges. It compares and spots out important vertices in a graph
Definition
The Weighted PageRank works like the original PageRank algorithm, except that it allows for a weight value assigned to each edge. This weight determines the fraction of the PageRank score that will flow from the source vertex through the current edge to its destination vertex.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It extends the scope of the PageRank applications by allowing edges with non-uniform weights, which can reflect better the structures underlying in graphs.
- Parameters:
graph
- the graph.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.weight
- edge property holding the weight of each edge in the graph.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.weightedPagerankAsync(graph, false, cost, rank); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
weightedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> weightedPagerankAsync(PgxGraph graph, double e, double d, int max, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
PageRank on weighted edges. It compares and spots out important vertices in a graph
Definition
The Weighted PageRank works like the original PageRank algorithm, except that it allows for a weight value assigned to each edge. This weight determines the fraction of the PageRank score that will flow from the source vertex through the current edge to its destination vertex.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It extends the scope of the PageRank applications by allowing edges with non-uniform weights, which can reflect better the structures underlying in graphs.
- Parameters:
graph
- the graph.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.weight
- edge property holding the weight of each edge in the graph.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.weightedPagerankAsync( graph, 0.001, 0.85, 100, cost, rank); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
weightedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> weightedPagerankAsync(PgxGraph graph, double e, double d, int max, boolean norm, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
PageRank on weighted edges. It compares and spots out important vertices in a graph
Definition
The Weighted PageRank works like the original PageRank algorithm, except that it allows for a weight value assigned to each edge. This weight determines the fraction of the PageRank score that will flow from the source vertex through the current edge to its destination vertex.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It extends the scope of the PageRank applications by allowing edges with non-uniform weights, which can reflect better the structures underlying in graphs.
- Parameters:
graph
- the graph.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.weight
- edge property holding the weight of each edge in the graph.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.weightedPagerankAsync( graph, 0.001, 0.85, 100, false, cost, rank); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
personalizedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedPagerankAsync(PgxGraph graph, PgxVertex<ID> v)
Personalized PageRank for a vertex of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedPagerankAsync(graph, vertex); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, boolean norm)
Personalized PageRank for a vertex of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedPagerankAsync(graph, vertex, false); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max)
Personalized PageRank for a vertex of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedPagerankAsync( graph, vertex, 0.001, 0.85, 100); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max, boolean norm)
Personalized PageRank for a vertex of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedPagerankAsync( graph, vertex, 0.001, 0.85, 100, false); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, VertexProperty<ID,java.lang.Double> rank)
Personalized PageRank for a vertex of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedPagerankAsync(graph, vertex, rank); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, boolean norm, VertexProperty<ID,java.lang.Double> rank)
Personalized PageRank for a vertex of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedPagerankAsync(graph, vertex, false, rank); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max, VertexProperty<ID,java.lang.Double> rank)
Personalized PageRank for a vertex of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedPagerankAsync( graph, vertex, 0.001, 0.85, 100, rank); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max, boolean norm, VertexProperty<ID,java.lang.Double> rank)
Personalized PageRank for a vertex of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedPagerankAsync( graph, vertex, 0.001, 0.85, 100, false, rank); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices)
Personalized PageRank for a set of vertices of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset of vertices.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedPagerankAsync(graph, vertices); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, boolean norm)
Personalized PageRank for a set of vertices of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset of vertices.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedPagerankAsync(graph, vertices, false); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max)
Personalized PageRank for a set of vertices of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset of vertices.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedPagerankAsync( graph, vertices, 0.001, 0.85, 100); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max, boolean norm)
Personalized PageRank for a set of vertices of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset of vertices.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedPagerankAsync( graph, vertices, 0.001, 0.85, 100, false); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, VertexProperty<ID,java.lang.Double> rank)
Personalized PageRank for a set of vertices of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset of vertices.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedPagerankAsync(graph, vertices, rank); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, boolean norm, VertexProperty<ID,java.lang.Double> rank)
Personalized PageRank for a set of vertices of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset of vertices.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedPagerankAsync( graph, vertices, false, rank); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max, VertexProperty<ID,java.lang.Double> rank)
Personalized PageRank for a set of vertices of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset of vertices.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedPagerankAsync( graph, vertices, 0.001, 0.85, 100, rank); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max, boolean norm, VertexProperty<ID,java.lang.Double> rank)
Personalized PageRank for a set of vertices of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset of vertices.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedPagerankAsync( graph, vertices, 0.001, 0.85, 100, false, rank); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedWeightedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, EdgeProperty<java.lang.Double> weight)
Personalized weighted pagerank for a vertex and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.weight
- edge property holding the weight of each edge in the graph.- Returns:
- vertex property holding the (normalized) weighted PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedWeightedPagerankAsync( graph, vertex, cost); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedWeightedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, boolean norm, EdgeProperty<java.lang.Double> weight)
Personalized weighted pagerank for a vertex and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.weight
- edge property holding the weight of each edge in the graph.- Returns:
- vertex property holding the (normalized) weighted PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedWeightedPagerankAsync( graph, vertex, false, cost); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedWeightedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max, EdgeProperty<java.lang.Double> weight)
Personalized weighted pagerank for a vertex and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.weight
- edge property holding the weight of each edge in the graph.- Returns:
- vertex property holding the (normalized) weighted PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedWeightedPagerankAsync( graph, vertex, 0.001, 0.85, 100, cost); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedWeightedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max, boolean norm, EdgeProperty<java.lang.Double> weight)
Personalized weighted pagerank for a vertex and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.weight
- edge property holding the weight of each edge in the graph.- Returns:
- vertex property holding the (normalized) weighted PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedWeightedPagerankAsync( graph, vertex, 0.001, 0.85, 100, false, cost); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedWeightedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
Personalized weighted pagerank for a vertex and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.weight
- edge property holding the weight of each edge in the graph.rank
- (out argument) vertex property holding the (normalized) weighted PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) weighted PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedWeightedPagerankAsync( graph, vertex, cost, rank); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedWeightedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, boolean norm, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
Personalized weighted pagerank for a vertex and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.weight
- edge property holding the weight of each edge in the graph.rank
- (out argument) vertex property holding the (normalized) weighted PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) weighted PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedWeightedPagerankAsync( graph, vertex, false, cost, rank); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedWeightedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
Personalized weighted pagerank for a vertex and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.weight
- edge property holding the weight of each edge in the graph.rank
- (out argument) vertex property holding the (normalized) weighted PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) weighted PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedWeightedPagerankAsync( graph, vertex, 0.001, 0.85, 100, cost, rank); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedWeightedPagerankAsync(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max, boolean norm, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
Personalized weighted pagerank for a vertex and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.weight
- edge property holding the weight of each edge in the graph.rank
- (out argument) vertex property holding the (normalized) weighted PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) weighted PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedWeightedPagerankAsync( graph, vertex, 0.001, 0.85, 100, false, cost, rank); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedWeightedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, EdgeProperty<java.lang.Double> weight)
Personalized pagerank for a set of vertices and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.weight
- edge property holding the weight of each edge in the graph.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedWeightedPagerankAsync( graph, vertices, cost); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedWeightedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, boolean norm, EdgeProperty<java.lang.Double> weight)
Personalized pagerank for a set of vertices and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.weight
- edge property holding the weight of each edge in the graph.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedWeightedPagerankAsync( graph, vertices, false, cost); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedWeightedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max, EdgeProperty<java.lang.Double> weight)
Personalized pagerank for a set of vertices and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.weight
- edge property holding the weight of each edge in the graph.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedWeightedPagerankAsync( graph, vertices, 0.001, 0.85, 100, cost); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedWeightedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max, boolean norm, EdgeProperty<java.lang.Double> weight)
Personalized pagerank for a set of vertices and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.weight
- edge property holding the weight of each edge in the graph.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedWeightedPagerankAsync( graph, vertices, 0.001, 0.85, 100, false, cost); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedWeightedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
Personalized pagerank for a set of vertices and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.weight
- edge property holding the weight of each edge in the graph.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedWeightedPagerankAsync( graph, vertices, cost, rank); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedWeightedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, boolean norm, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
Personalized pagerank for a set of vertices and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.weight
- edge property holding the weight of each edge in the graph.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedWeightedPagerankAsync( graph, vertices, false, cost, rank); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedWeightedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
Personalized pagerank for a set of vertices and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.weight
- edge property holding the weight of each edge in the graph.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedWeightedPagerankAsync( graph, vertices, 0.001, 0.85, 100, cost, rank); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedWeightedPagerankAsync(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max, boolean norm, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank)
Personalized pagerank for a set of vertices and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.weight
- edge property holding the weight of each edge in the graph.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedWeightedPagerankAsync( graph, vertices, 0.001, 0.85, 100, false, cost, rank); promise.thenCompose(pagerank -> graph.queryPgqlAsync( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
articleRankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> articleRankAsync(PgxGraph graph)
ArticleRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
ArticleRank is a variant of the PageRank algorithm and operates in a similar way. It computes the ranking score for the vertices by analyzing the incoming edges, while reducing the assumption that relationships with nodes that have a low out-degree are of higher importance.
Implementation Details
The implementation of this algorithm uses an iterative method. The ArticleRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- ArticleRank can be used to measure the influence of articles and academic papers based on their citation analysis. The computed rank indicates how frequently an article is cited.
- Parameters:
graph
- the graph.- Returns:
- vertex property holding the (normalized) ArticleRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxFuture<VertexProperty<Integer, Double>> promise = analyst.articleRankAsync(graph); promise.thenCompose(articlerank -> graph.queryPgqlAsync( "SELECT x, x." + articlerank.getName() + " MATCH (x) ORDER BY x." + articlerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
articleRankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> articleRankAsync(PgxGraph graph, boolean norm)
ArticleRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
ArticleRank is a variant of the PageRank algorithm and operates in a similar way. It computes the ranking score for the vertices by analyzing the incoming edges, while reducing the assumption that relationships with nodes that have a low out-degree are of higher importance.
Implementation Details
The implementation of this algorithm uses an iterative method. The ArticleRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- ArticleRank can be used to measure the influence of articles and academic papers based on their citation analysis. The computed rank indicates how frequently an article is cited.
- Parameters:
graph
- the graph.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.- Returns:
- vertex property holding the (normalized) ArticleRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxFuture<VertexProperty<Integer, Double>> promise = analyst.articleRankAsync(graph, false); promise.thenCompose(articlerank -> graph.queryPgqlAsync( "SELECT x, x." + articlerank.getName() + " MATCH (x) ORDER BY x." + articlerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
articleRankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> articleRankAsync(PgxGraph graph, double e, double d, int max)
ArticleRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
ArticleRank is a variant of the PageRank algorithm and operates in a similar way. It computes the ranking score for the vertices by analyzing the incoming edges, while reducing the assumption that relationships with nodes that have a low out-degree are of higher importance.
Implementation Details
The implementation of this algorithm uses an iterative method. The ArticleRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- ArticleRank can be used to measure the influence of articles and academic papers based on their citation analysis. The computed rank indicates how frequently an article is cited.
- Parameters:
graph
- the graph.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.- Returns:
- vertex property holding the (normalized) ArticleRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxFuture<VertexProperty<Integer, Double>> promise = analyst.articleRankAsync(graph, 0.001, 0.85, 100); promise.thenCompose(articlerank -> graph.queryPgqlAsync( "SELECT x, x." + articlerank.getName() + " MATCH (x) ORDER BY x." + articlerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
articleRankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> articleRankAsync(PgxGraph graph, double e, double d, int max, boolean norm)
ArticleRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
ArticleRank is a variant of the PageRank algorithm and operates in a similar way. It computes the ranking score for the vertices by analyzing the incoming edges, while reducing the assumption that relationships with nodes that have a low out-degree are of higher importance.
Implementation Details
The implementation of this algorithm uses an iterative method. The ArticleRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- ArticleRank can be used to measure the influence of articles and academic papers based on their citation analysis. The computed rank indicates how frequently an article is cited.
- Parameters:
graph
- the graph.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.- Returns:
- vertex property holding the (normalized) ArticleRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxFuture<VertexProperty<Integer, Double>> promise = analyst.articleRankAsync(graph, 0.001, 0.85, 100, false); promise.thenCompose(articlerank -> graph.queryPgqlAsync( "SELECT x, x." + articlerank.getName() + " MATCH (x) ORDER BY x." + articlerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
articleRankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> articleRankAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> rank)
ArticleRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
ArticleRank is a variant of the PageRank algorithm and operates in a similar way. It computes the ranking score for the vertices by analyzing the incoming edges, while reducing the assumption that relationships with nodes that have a low out-degree are of higher importance.
Implementation Details
The implementation of this algorithm uses an iterative method. The ArticleRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- ArticleRank can be used to measure the influence of articles and academic papers based on their citation analysis. The computed rank indicates how frequently an article is cited.
- Parameters:
graph
- the graph.rank
- (out argument) vertex property holding the (normalized) ArticleRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) ArticleRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.articleRankAsync(graph, rank); promise.thenCompose(articlerank -> graph.queryPgqlAsync( "SELECT x, x." + articlerank.getName() + " MATCH (x) ORDER BY x." + articlerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
articleRankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> articleRankAsync(PgxGraph graph, boolean norm, VertexProperty<ID,java.lang.Double> rank)
ArticleRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
ArticleRank is a variant of the PageRank algorithm and operates in a similar way. It computes the ranking score for the vertices by analyzing the incoming edges, while reducing the assumption that relationships with nodes that have a low out-degree are of higher importance.
Implementation Details
The implementation of this algorithm uses an iterative method. The ArticleRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- ArticleRank can be used to measure the influence of articles and academic papers based on their citation analysis. The computed rank indicates how frequently an article is cited.
- Parameters:
graph
- the graph.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.rank
- (out argument) vertex property holding the (normalized) ArticleRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) ArticleRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.articleRankAsync(graph, false, rank); promise.thenCompose(articlerank -> graph.queryPgqlAsync( "SELECT x, x." + articlerank.getName() + " MATCH (x) ORDER BY x." + articlerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
articleRankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> articleRankAsync(PgxGraph graph, double e, double d, int max, VertexProperty<ID,java.lang.Double> rank)
ArticleRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
ArticleRank is a variant of the PageRank algorithm and operates in a similar way. It computes the ranking score for the vertices by analyzing the incoming edges, while reducing the assumption that relationships with nodes that have a low out-degree are of higher importance.
Implementation Details
The implementation of this algorithm uses an iterative method. The ArticleRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- ArticleRank can be used to measure the influence of articles and academic papers based on their citation analysis. The computed rank indicates how frequently an article is cited.
- Parameters:
graph
- the graph.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.rank
- (out argument) vertex property holding the (normalized) ArticleRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) ArticleRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.articleRankAsync(graph, 0.001, 0.85, 100, rank); promise.thenCompose(articlerank -> graph.queryPgqlAsync( "SELECT x, x." + articlerank.getName() + " MATCH (x) ORDER BY x." + articlerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
articleRankAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> articleRankAsync(PgxGraph graph, double e, double d, int max, boolean norm, VertexProperty<ID,java.lang.Double> rank)
ArticleRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
ArticleRank is a variant of the PageRank algorithm and operates in a similar way. It computes the ranking score for the vertices by analyzing the incoming edges, while reducing the assumption that relationships with nodes that have a low out-degree are of higher importance.
Implementation Details
The implementation of this algorithm uses an iterative method. The ArticleRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- ArticleRank can be used to measure the influence of articles and academic papers based on their citation analysis. The computed rank indicates how frequently an article is cited.
- Parameters:
graph
- the graph.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.rank
- (out argument) vertex property holding the (normalized) ArticleRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) ArticleRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.articleRankAsync(graph, 0.001, 0.85, 100, false, rank); promise.thenCompose(articlerank -> graph.queryPgqlAsync( "SELECT x, x." + articlerank.getName() + " MATCH (x) ORDER BY x." + articlerank.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
vertexBetweennessCentralityAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> vertexBetweennessCentralityAsync(PgxGraph graph)
Betweenness centrality measures the centrality of the vertices to identify important vertices for the flow of information
Definition
The Betweenness Centrality of a vertex V in a graph is the sum of the fraction of shortest paths that pass through V from all the possible shortest paths connecting every possible pair of vertices S, T in the graph, such that V is different from S and T. Because of its definition, the algorithm is meant for connected graphs.
Implementation Details
The implementation of this algorithm uses a parallel BFS method called Multi-Source BFS (MS-BSF) for a faster and more efficient search of the shortests paths. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- The coefficient from betweenness centrality can be used to identify vertices in a graph that are vital for the flow of information within it, making it a good option for applications in social networks and problems modelling flows of any kind.
- Parameters:
graph
- the graph.- Returns:
- vertex property holding the betweenness centrality value for each vertex.
Examples
PgxGraph graph = ...; PgxFuture<VertexProperty<Integer, Double>> promise = analyst.vertexBetweennessCentralityAsync(graph); promise.thenCompose(betweenness -> graph.queryPgqlAsync( "SELECT x, x." + betweenness.getName() + " MATCH (x) ORDER BY x." + betweenness.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
vertexBetweennessCentralityAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> vertexBetweennessCentralityAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> bc)
Betweenness centrality measures the centrality of the vertices to identify important vertices for the flow of information
Definition
The Betweenness Centrality of a vertex V in a graph is the sum of the fraction of shortest paths that pass through V from all the possible shortest paths connecting every possible pair of vertices S, T in the graph, such that V is different from S and T. Because of its definition, the algorithm is meant for connected graphs.
Implementation Details
The implementation of this algorithm uses a parallel BFS method called Multi-Source BFS (MS-BSF) for a faster and more efficient search of the shortests paths. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- The coefficient from betweenness centrality can be used to identify vertices in a graph that are vital for the flow of information within it, making it a good option for applications in social networks and problems modelling flows of any kind.
- Parameters:
graph
- the graph.bc
- (out argument) vertex property holding the betweenness centrality value for each vertex.- Returns:
- vertex property holding the betweenness centrality value for each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> bc = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.vertexBetweennessCentralityAsync(graph, bc); promise.thenCompose(betweenness -> graph.queryPgqlAsync( "SELECT x, x." + betweenness.getName() + " MATCH (x) ORDER BY x." + betweenness.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
approximateVertexBetweennessCentralityAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> approximateVertexBetweennessCentralityAsync(PgxGraph graph, int k)
Faster, but less accurate than betweenness centrality, it identifies important vertices for the flow of information
Definition
This variant of betweenness centrality approximates the centrality of the vertices by just using k random vertices as starting points for the BFS traversals of the graph, instead of computing the exact value by using all the vertices in the graph.
Implementation Details
The implementation of this algorithm uses a built-in BFS method for the graph traversals. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- The coefficient from betweenness centrality can be used to identify vertices in a graph that are vital for the flow of information within it, making it a good option for applications in social networks and problems modelling flows of any kind.
- Parameters:
graph
- the graph.k
- number of random vertices to be used to compute the approximated betweenness centrality coefficients.- Returns:
- vertex property holding the betweenness centrality value for each vertex.
Examples
PgxGraph graph = ...; PgxFuture<VertexProperty<Integer, Double>> promise = analyst.approximateVertexBetweennessCentralityAsync( graph, 100); promise.thenCompose(betweenness -> graph.queryPgqlAsync( "SELECT x, x." + betweenness.getName() + " MATCH (x) ORDER BY x." + betweenness.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
approximateVertexBetweennessCentralityAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> approximateVertexBetweennessCentralityAsync(PgxGraph graph, int k, VertexProperty<ID,java.lang.Double> bc)
Faster, but less accurate than betweenness centrality, it identifies important vertices for the flow of information
Definition
This variant of betweenness centrality approximates the centrality of the vertices by just using k random vertices as starting points for the BFS traversals of the graph, instead of computing the exact value by using all the vertices in the graph.
Implementation Details
The implementation of this algorithm uses a built-in BFS method for the graph traversals. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- The coefficient from betweenness centrality can be used to identify vertices in a graph that are vital for the flow of information within it, making it a good option for applications in social networks and problems modelling flows of any kind.
- Parameters:
graph
- the graph.k
- number of random vertices to be used to compute the approximated betweenness centrality coefficients.bc
- (out argument) vertex property holding the betweenness centrality value for each vertex.- Returns:
- vertex property holding the betweenness centrality value for each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> bc = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.approximateVertexBetweennessCentralityAsync( graph, 100, bc); promise.thenCompose(betweenness -> graph.queryPgqlAsync( "SELECT x, x." + betweenness.getName() + " MATCH (x) ORDER BY x." + betweenness.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
approximateVertexBetweennessCentralityFromSeedsAsync
@SafeVarargs public final <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> approximateVertexBetweennessCentralityFromSeedsAsync(PgxGraph graph, PgxVertex<ID>... seeds)
Faster, but less accurate than betweenness centrality, it identifies important vertices for the flow of information
Definition
This variant of betweenness centrality approximates the centrality of the vertices by just using the vertices from the given sequence as starting points for the BFS traversals of the graph, instead of computing the exact value by using all the vertices in the graph.
Implementation Details
The implementation of this algorithm uses a built-in BFS method for the graph traversals. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- The coefficient from betweenness centrality can be used to identify vertices in a graph that are vital for the flow of information within it, making it a good option for applications in social networks and problems modelling flows of any kind.
- Parameters:
graph
- the graph.seeds
- the (unique) chosen nodes to be used to compute the approximated betweenness centrality coeficients.- Returns:
- vertex property holding the betweenness centrality value for each vertex.
Examples
PgxGraph graph = ...; PgxVertex<Integer> v1 = graph.getVertex(128); PgxVertex<Integer> v2 = graph.getVertex(333); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.approximateVertexBetweennessCentralityFromSeedsAsync( graph, v1, v2); promise.thenCompose(betweenness -> graph.queryPgqlAsync( "SELECT x, x." + betweenness.getName() + " MATCH (x) ORDER BY x." + betweenness.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
approximateVertexBetweennessCentralityFromSeedsAsync
@SafeVarargs public final <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> approximateVertexBetweennessCentralityFromSeedsAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> bc, PgxVertex<ID>... seeds)
Faster, but less accurate than betweenness centrality, it identifies important vertices for the flow of information
Definition
This variant of betweenness centrality approximates the centrality of the vertices by just using the vertices from the given sequence as starting points for the BFS traversals of the graph, instead of computing the exact value by using all the vertices in the graph.
Implementation Details
The implementation of this algorithm uses a built-in BFS method for the graph traversals. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- The coefficient from betweenness centrality can be used to identify vertices in a graph that are vital for the flow of information within it, making it a good option for applications in social networks and problems modelling flows of any kind.
- Parameters:
graph
- the graph.bc
- (out argument) vertex property holding the betweenness centrality value for each vertex.seeds
- the (unique) chosen nodes to be used to compute the approximated betweenness centrality coeficients.- Returns:
- vertex property holding the betweenness centrality value for each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> bc = graph.createVertexProperty(PropertyType.DOUBLE); PgxVertex<Integer> v1 = graph.getVertex(128); PgxVertex<Integer> v2 = graph.getVertex(333); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.approximateVertexBetweennessCentralityFromSeedsAsync( graph, bc, v1, v2); promise.thenCompose(betweenness -> graph.queryPgqlAsync( "SELECT x, x." + betweenness.getName() + " MATCH (x) ORDER BY x." + betweenness.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
closenessCentralityUnitLengthAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> closenessCentralityUnitLengthAsync(PgxGraph graph)
Closeness centrality measures the centrality of the vertices based on distances, allowing to find well-connected vertices
Definition
The Closeness Centrality of a node V is the reciprocal of the sum of all the distances from the possible shortest paths starting from V. Thus the higher the centrality value of V, the closer it is to all the other vertices in the graph.
Implementation Details
The implementation of this algorithm uses a parallel BFS method called Multi-Source BFS (MS-BSF) for a faster and more efficient search of the shortests paths. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- The coefficient from closeness centrality can be used to identify vertices in a graph that are close and well connected to other vertices, hence it can be used in many applications for social networks when looking for vertices to spread information in a fast way.
- Parameters:
graph
- the graph.- Returns:
- node property holding the closeness centrality value for each node.
Examples
PgxGraph graph = ...; PgxFuture<VertexProperty<Integer, Double>> promise = analyst.closenessCentralityUnitLengthAsync(graph); promise.thenCompose(closeness -> graph.queryPgqlAsync( "SELECT x, x." + closeness.getName() + " MATCH (x) ORDER BY x." + closeness.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
closenessCentralityUnitLengthAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> closenessCentralityUnitLengthAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> cc)
Closeness centrality measures the centrality of the vertices based on distances, allowing to find well-connected vertices
Definition
The Closeness Centrality of a node V is the reciprocal of the sum of all the distances from the possible shortest paths starting from V. Thus the higher the centrality value of V, the closer it is to all the other vertices in the graph.
Implementation Details
The implementation of this algorithm uses a parallel BFS method called Multi-Source BFS (MS-BSF) for a faster and more efficient search of the shortests paths. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- The coefficient from closeness centrality can be used to identify vertices in a graph that are close and well connected to other vertices, hence it can be used in many applications for social networks when looking for vertices to spread information in a fast way.
- Parameters:
graph
- the graph.cc
- (out argument) node property holding the closeness centrality value for each node.- Returns:
- node property holding the closeness centrality value for each node.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> cc = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.closenessCentralityUnitLengthAsync(graph, cc); promise.thenCompose(closeness -> graph.queryPgqlAsync( "SELECT x, x." + closeness.getName() + " MATCH (x) ORDER BY x." + closeness.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
closenessCentralityDoubleLengthAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> closenessCentralityDoubleLengthAsync(PgxGraph graph, EdgeProperty<java.lang.Double> cost)
Closeness centrality measures the centrality of the vertices based on weighted distances, allowing to find well-connected vertices
Definition
This variant of Closeness Centrality takes into account the weights from the edges when computing the reciprocal of the sum of all the distances from the possible shortest paths starting from the vertex V, for every vertex in the graph. The weights of the edges must be positive values greater than 0.
Implementation Details
The implementation of is more expensive to compute than the normal closeness centrality because of the inclusion of the weights in the edges which influence the selection of edges for the shortest paths. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E * d) with E = number of edges, V = number of vertices, d = diameter of the graph
- Space:
O(5 * V) with V = number of vertices
Default Values
Applications
- The coefficient from closeness centrality can be used to identify vertices in a graph that are close and well connected to other vertices, hence it can be used in many applications for social networks when looking for vertices to spread information in a fast way.
- Parameters:
graph
- the graph.cost
- edge property holding the weight of each edge in the graph.- Returns:
- vertex property holding the closeness centrality value for each vertex.
Examples
PgxGraph graph = ...; EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.closenessCentralityDoubleLengthAsync(graph, cost); promise.thenCompose(closeness -> graph.queryPgqlAsync( "SELECT x, x." + closeness.getName() + " MATCH (x) ORDER BY x." + closeness.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
closenessCentralityDoubleLengthAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> closenessCentralityDoubleLengthAsync(PgxGraph graph, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,java.lang.Double> cc)
Closeness centrality measures the centrality of the vertices based on weighted distances, allowing to find well-connected vertices
Definition
This variant of Closeness Centrality takes into account the weights from the edges when computing the reciprocal of the sum of all the distances from the possible shortest paths starting from the vertex V, for every vertex in the graph. The weights of the edges must be positive values greater than 0.
Implementation Details
The implementation of is more expensive to compute than the normal closeness centrality because of the inclusion of the weights in the edges which influence the selection of edges for the shortest paths. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E * d) with E = number of edges, V = number of vertices, d = diameter of the graph
- Space:
O(5 * V) with V = number of vertices
Default Values
Applications
- The coefficient from closeness centrality can be used to identify vertices in a graph that are close and well connected to other vertices, hence it can be used in many applications for social networks when looking for vertices to spread information in a fast way.
- Parameters:
graph
- the graph.cost
- edge property holding the weight of each edge in the graph.cc
- (out argument) vertex property holding the closeness centrality value for each vertex.- Returns:
- vertex property holding the closeness centrality value for each vertex.
Examples
PgxGraph graph = ...; EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> cc = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.closenessCentralityDoubleLengthAsync(graph, cost, cc); promise.thenCompose(closeness -> graph.queryPgqlAsync( "SELECT x, x." + closeness.getName() + " MATCH (x) ORDER BY x." + closeness.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
hitsAsync
public <ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Double>,VertexProperty<ID,java.lang.Double>>> hitsAsync(PgxGraph graph)
HITS assigns ranking scores to the vertices, aimed to assess the quality of information and references in linked structures
Definition
HITS is an algorithm that computes two ranking scores (authority and hub)for each vertex in the graph. The idea of hubs and authorities comes from the web pages: a hub is regarded as a page that is not authoritative in a specific topic, but it has instead links to authority pages, which are regarded as meaningful sources for a particular topic by many hubs. Thus a good hub will point to many authorities, while a good authority will be pointed by many hubs. The authority score of a vertex V is computed by adding all the hub scores of its incoming neighbors (i.e. vertices with edges pointing to V). The hub score is computed in a similar way, using the authority scores instead.
Implementation Details
The implementation of this algorithm uses an iterative method. Both, authority and hub scores, of all the vertices in the graph are computed and updated at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- HITS was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- the graph.- Returns:
- Pair holding the two vertex properties with the authority and hub scores.
Examples
PgxGraph graph = ...; PgxFuture<Pair<VertexProperty<Integer, Double>, VertexProperty<Integer, Double>>> promise = analyst.hitsAsync( graph); promise.thenCompose(hits -> graph.queryPgqlAsync( "SELECT x, x." + hits.getFirst().getName() + " x." + hits.getSecond().getName() + " MATCH (x) ORDER BY x." + hits.getFirst().getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
hitsAsync
public <ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Double>,VertexProperty<ID,java.lang.Double>>> hitsAsync(PgxGraph graph, int max)
HITS assigns ranking scores to the vertices, aimed to assess the quality of information and references in linked structures
Definition
HITS is an algorithm that computes two ranking scores (authority and hub)for each vertex in the graph. The idea of hubs and authorities comes from the web pages: a hub is regarded as a page that is not authoritative in a specific topic, but it has instead links to authority pages, which are regarded as meaningful sources for a particular topic by many hubs. Thus a good hub will point to many authorities, while a good authority will be pointed by many hubs. The authority score of a vertex V is computed by adding all the hub scores of its incoming neighbors (i.e. vertices with edges pointing to V). The hub score is computed in a similar way, using the authority scores instead.
Implementation Details
The implementation of this algorithm uses an iterative method. Both, authority and hub scores, of all the vertices in the graph are computed and updated at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- HITS was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- the graph.max
- number of iterations that will be performed.- Returns:
- Pair holding the two vertex properties with the authority and hub scores.
Examples
PgxGraph graph = ...; PgxFuture<Pair<VertexProperty<Integer, Double>, VertexProperty<Integer, Double>>> promise = analyst.hitsAsync( graph, 100); promise.thenCompose(hits -> graph.queryPgqlAsync( "SELECT x, x." + hits.getFirst().getName() + " x." + hits.getSecond().getName() + " MATCH (x) ORDER BY x." + hits.getFirst().getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
hitsAsync
public <ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Double>,VertexProperty<ID,java.lang.Double>>> hitsAsync(PgxGraph graph, int max, VertexProperty<ID,java.lang.Double> auth, VertexProperty<ID,java.lang.Double> hubs)
HITS assigns ranking scores to the vertices, aimed to assess the quality of information and references in linked structures
Definition
HITS is an algorithm that computes two ranking scores (authority and hub)for each vertex in the graph. The idea of hubs and authorities comes from the web pages: a hub is regarded as a page that is not authoritative in a specific topic, but it has instead links to authority pages, which are regarded as meaningful sources for a particular topic by many hubs. Thus a good hub will point to many authorities, while a good authority will be pointed by many hubs. The authority score of a vertex V is computed by adding all the hub scores of its incoming neighbors (i.e. vertices with edges pointing to V). The hub score is computed in a similar way, using the authority scores instead.
Implementation Details
The implementation of this algorithm uses an iterative method. Both, authority and hub scores, of all the vertices in the graph are computed and updated at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- HITS was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- the graph.max
- number of iterations that will be performed.auth
- (out argument) vertex property holding the authority score for each vertex.hubs
- (out argument) vertex property holding the hub score for each vertex.- Returns:
- Pair holding the two vertex properties with the authority and hub scores.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> auth = graph.CreateVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> hubs = graph.CreateVertexProperty(PropertyType.DOUBLE); PgxFuture<Pair<VertexProperty<Integer, Double>, VertexProperty<Integer, Double>>> promise = analyst.hitsAsync( graph, 100, auth, hubs); promise.thenCompose(hits -> graph.queryPgqlAsync( "SELECT x, x." + hits.getFirst().getName() + " x." + hits.getSecond().getName() + " MATCH (x) ORDER BY x." + hits.getFirst().getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
hitsAsync
public <ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Double>,VertexProperty<ID,java.lang.Double>>> hitsAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> auth, VertexProperty<ID,java.lang.Double> hubs)
HITS assigns ranking scores to the vertices, aimed to assess the quality of information and references in linked structures
Definition
HITS is an algorithm that computes two ranking scores (authority and hub)for each vertex in the graph. The idea of hubs and authorities comes from the web pages: a hub is regarded as a page that is not authoritative in a specific topic, but it has instead links to authority pages, which are regarded as meaningful sources for a particular topic by many hubs. Thus a good hub will point to many authorities, while a good authority will be pointed by many hubs. The authority score of a vertex V is computed by adding all the hub scores of its incoming neighbors (i.e. vertices with edges pointing to V). The hub score is computed in a similar way, using the authority scores instead.
Implementation Details
The implementation of this algorithm uses an iterative method. Both, authority and hub scores, of all the vertices in the graph are computed and updated at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- HITS was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- the graph.auth
- (out argument) vertex property holding the authority score for each vertex.hubs
- (out argument) vertex property holding the hub score for each vertex.- Returns:
- Pair holding the two vertex properties with the authority and hub scores.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> auth = graph.CreateVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> hubs = graph.CreateVertexProperty(PropertyType.DOUBLE); PgxFuture<Pair<VertexProperty<Integer, Double>, VertexProperty<Integer, Double>>> promise = analyst.hitsAsync( graph, auth, hubs); promise.thenCompose(hits -> graph.queryPgqlAsync( "SELECT x, x." + hits.getFirst().getName() + " x." + hits.getSecond().getName() + " MATCH (x) ORDER BY x." + hits.getFirst().getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
eigenvectorCentralityAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> eigenvectorCentralityAsync(PgxGraph graph)
Eigenvector centrality gets the centrality of the vertices in an intricate way using neighbors, allowing to find well-connected vertices
Definition
The Eigenvector Centrality determines the centrality of a vertex by adding and weighting the centrality of its neighbors. Using outgoing or incoming edges when computing the eigenvector centrality will be equivalent to do so with the normal or the transpose adjacency matrix, respectively leading to the "right" and "left" eigenvectors.
Implementation Details
The implementation of this algorithm uses the power iteration method.
Complexity
- Time:
O(V * k) with V = number of vertices, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
- max_iter: 100
- max_diff: 0.001
- use_l2norm: false
- use_inEdges: false
Applications
- The eigenvector centrality assigns higher scores to vertices that are connected to other well-connected vertices in the graphs, making this algorithm a good option to find important or relevant people in social networks.
- Parameters:
graph
- the graph.- Returns:
- vertex property holding the normalized centrality value for each vertex.
Examples
PgxGraph graph = ...; PgxFuture<VertexProperty<Integer, Double>> promise = analyst.eigenvectorCentralityAsync(graph); promise.thenCompose(eigenvector -> graph.queryPgqlAsync( "SELECT x, x." + eigenvector.getName() + " MATCH (x) ORDER BY x." + eigenvector.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
eigenvectorCentralityAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> eigenvectorCentralityAsync(PgxGraph graph, int max, double maxDiff, boolean useL2Norm, boolean useInEdge)
Eigenvector centrality gets the centrality of the vertices in an intricate way using neighbors, allowing to find well-connected vertices
Definition
The Eigenvector Centrality determines the centrality of a vertex by adding and weighting the centrality of its neighbors. Using outgoing or incoming edges when computing the eigenvector centrality will be equivalent to do so with the normal or the transpose adjacency matrix, respectively leading to the "right" and "left" eigenvectors.
Implementation Details
The implementation of this algorithm uses the power iteration method.
Complexity
- Time:
O(V * k) with V = number of vertices, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
- max_iter: 100
- max_diff: 0.001
- use_l2norm: false
- use_inEdges: false
Applications
- The eigenvector centrality assigns higher scores to vertices that are connected to other well-connected vertices in the graphs, making this algorithm a good option to find important or relevant people in social networks.
- Parameters:
graph
- the graph.max
- maximum number of iterations that will be performed.maxDiff
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.useL2Norm
- boolean flag to determine whether the algorithm will use the l2 norm (Euclidean norm) or the l1 norm (absolute value) to normalize the centrality scores.useInEdge
- boolean flag to determine whether the algorithm will use the incoming or the outgoing edges in the graph for the computations.- Returns:
- vertex property holding the normalized centrality value for each vertex.
Examples
PgxGraph graph = ...; PgxFuture<VertexProperty<Integer, Double>> promise = analyst.eigenvectorCentralityAsync( graph, 100, 0.001, false, false); promise.thenCompose(eigenvector -> graph.queryPgqlAsync( "SELECT x, x." + eigenvector.getName() + " MATCH (x) ORDER BY x." + eigenvector.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
eigenvectorCentralityAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> eigenvectorCentralityAsync(PgxGraph graph, int max, double maxDiff, boolean useL2Norm, boolean useInEdge, VertexProperty<ID,java.lang.Double> ec)
Eigenvector centrality gets the centrality of the vertices in an intricate way using neighbors, allowing to find well-connected vertices
Definition
The Eigenvector Centrality determines the centrality of a vertex by adding and weighting the centrality of its neighbors. Using outgoing or incoming edges when computing the eigenvector centrality will be equivalent to do so with the normal or the transpose adjacency matrix, respectively leading to the "right" and "left" eigenvectors.
Implementation Details
The implementation of this algorithm uses the power iteration method.
Complexity
- Time:
O(V * k) with V = number of vertices, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
- max_iter: 100
- max_diff: 0.001
- use_l2norm: false
- use_inEdges: false
Applications
- The eigenvector centrality assigns higher scores to vertices that are connected to other well-connected vertices in the graphs, making this algorithm a good option to find important or relevant people in social networks.
- Parameters:
graph
- the graph.max
- maximum number of iterations that will be performed.maxDiff
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.useL2Norm
- boolean flag to determine whether the algorithm will use the l2 norm (Euclidean norm) or the l1 norm (absolute value) to normalize the centrality scores.useInEdge
- boolean flag to determine whether the algorithm will use the incoming or the outgoing edges in the graph for the computations.ec
- (out argument) vertex property holding the normalized centrality value for each vertex.- Returns:
- vertex property holding the normalized centrality value for each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> ec = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.eigenvectorCentralityAsync( graph, 100, 0.001, false, false, ec); promise.thenCompose(eigenvector -> graph.queryPgqlAsync( "SELECT x, x." + eigenvector.getName() + " MATCH (x) ORDER BY x." + eigenvector.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
eigenvectorCentralityAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> eigenvectorCentralityAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> ec)
Eigenvector centrality gets the centrality of the vertices in an intricate way using neighbors, allowing to find well-connected vertices
Definition
The Eigenvector Centrality determines the centrality of a vertex by adding and weighting the centrality of its neighbors. Using outgoing or incoming edges when computing the eigenvector centrality will be equivalent to do so with the normal or the transpose adjacency matrix, respectively leading to the "right" and "left" eigenvectors.
Implementation Details
The implementation of this algorithm uses the power iteration method.
Complexity
- Time:
O(V * k) with V = number of vertices, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
- max_iter: 100
- max_diff: 0.001
- use_l2norm: false
- use_inEdges: false
Applications
- The eigenvector centrality assigns higher scores to vertices that are connected to other well-connected vertices in the graphs, making this algorithm a good option to find important or relevant people in social networks.
- Parameters:
graph
- the graph.ec
- (out argument) vertex property holding the normalized centrality value for each vertex.- Returns:
- vertex property holding the normalized centrality value for each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> ec = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.eigenvectorCentralityAsync(graph, ec); promise.thenCompose(eigenvector -> graph.queryPgqlAsync( "SELECT x, x." + eigenvector.getName() + " MATCH (x) ORDER BY x." + eigenvector.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
outDegreeCentralityAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Integer>> outDegreeCentralityAsync(PgxGraph graph)
Out-degree centrality measures the centrality of the vertices based on its degree, letting you see how a vertex influences its neighborhood
Definition
Out-Degree centrality returns the sum of the number of outgoing edges for each vertex in the graph.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelism.
Complexity
- Time:
O(V) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Since out-degree centrality accounts for the connections of the vertices, it can be used to see the influence a vertex has over the vertices in its immediate neighborhood.
- Parameters:
graph
- the graph.- Returns:
- vertex property holding the degree centrality value for each vertex in the graph.
Examples
PgxGraph graph = ...; PgxFuture<VertexProperty<Integer, Integer>> promise = analyst.outDegreeCentralityAsync(graph); promise.thenCompose(degree -> graph.queryPgqlAsync( "SELECT x, x." + degree.getName() + " MATCH (x) ORDER BY x." + degree.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
outDegreeCentralityAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Integer>> outDegreeCentralityAsync(PgxGraph graph, VertexProperty<ID,java.lang.Integer> dc)
Out-degree centrality measures the centrality of the vertices based on its degree, letting you see how a vertex influences its neighborhood
Definition
Out-Degree centrality returns the sum of the number of outgoing edges for each vertex in the graph.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelism.
Complexity
- Time:
O(V) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Since out-degree centrality accounts for the connections of the vertices, it can be used to see the influence a vertex has over the vertices in its immediate neighborhood.
- Parameters:
graph
- the graph.dc
- (out argument) vertex property holding the degree centrality value for each vertex in the graph.- Returns:
- vertex property holding the degree centrality value for each vertex in the graph.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Integer> dc = graph.createVertexProperty(PropertyType.INTEGER); PgxFuture<VertexProperty<Integer, Integer>> promise = analyst.outDegreeCentralityAsync(graph, dc); promise.thenCompose(degree -> graph.queryPgqlAsync( "SELECT x, x." + degree.getName() + " MATCH (x) ORDER BY x." + degree.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
outDegreeCentralityAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Integer>> outDegreeCentralityAsync(PgxGraph graph, java.lang.String propertyName)
-
inDegreeCentralityAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Integer>> inDegreeCentralityAsync(PgxGraph graph)
In-degree centrality measures the centrality of the vertices based on its degree, letting you see how a vertex influences its neighborhood
Definition
In-Degree centrality returns the sum of the number of incoming edges for each vertex in the graph.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelism.
Complexity
- Time:
O(V) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Since in-degree centrality accounts for the connections of the vertices, it can be used to see the influence a vertex has over the vertices in its immediate neighborhood.
- Parameters:
graph
- the graph.- Returns:
- vertex property holding the degree centrality value for each vertex in the graph.
Examples
PgxGraph graph = ...; PgxFuture<VertexProperty<Integer, Integer>> promise = analyst.inDegreeCentralityAsync(graph); promise.thenCompose(degree -> graph.queryPgqlAsync( "SELECT x, x." + degree.getName() + " MATCH (x) ORDER BY x." + degree.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
inDegreeCentralityAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Integer>> inDegreeCentralityAsync(PgxGraph graph, VertexProperty<ID,java.lang.Integer> dc)
In-degree centrality measures the centrality of the vertices based on its degree, letting you see how a vertex influences its neighborhood
Definition
In-Degree centrality returns the sum of the number of incoming edges for each vertex in the graph.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelism.
Complexity
- Time:
O(V) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Since in-degree centrality accounts for the connections of the vertices, it can be used to see the influence a vertex has over the vertices in its immediate neighborhood.
- Parameters:
graph
- the graph.dc
- (out argument) vertex property holding the degree centrality value for each vertex in the graph.- Returns:
- vertex property holding the degree centrality value for each vertex in the graph.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Integer> dc = graph.createVertexProperty(PropertyType.INTEGER); PgxFuture<VertexProperty<Integer, Integer>> promise = analyst.inDegreeCentralityAsync(graph, dc); promise.thenCompose(degree -> graph.queryPgqlAsync( "SELECT x, x." + degree.getName() + " MATCH (x) ORDER BY x." + degree.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
inDegreeCentralityAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Integer>> inDegreeCentralityAsync(PgxGraph graph, java.lang.String propertyName)
-
degreeCentralityAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Integer>> degreeCentralityAsync(PgxGraph graph)
Degree centrality measures the centrality of the vertices based on its degree, letting you see how a vertex influences its neighborhood
Definition
Degree centrality counts the number of outgoing and incoming edges for each vertex in the graph.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Since degree centrality accounts for the connections of the vertices, it can be used to see the influence a vertex has over the vertices in its immediate neighborhood.
- Parameters:
graph
- the graph.- Returns:
- vertex property holding the degree centrality value for each vertex in the graph.
Examples
PgxGraph graph = ...; PgxFuture<VertexProperty<Integer, Integer>> promise = analyst.degreeCentralityAsync(graph); promise.thenCompose(degree -> graph.queryPgqlAsync( "SELECT x, x." + degree.getName() + " MATCH (x) ORDER BY x." + degree.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
degreeCentralityAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Integer>> degreeCentralityAsync(PgxGraph graph, VertexProperty<ID,java.lang.Integer> dc)
Degree centrality measures the centrality of the vertices based on its degree, letting you see how a vertex influences its neighborhood
Definition
Degree centrality counts the number of outgoing and incoming edges for each vertex in the graph.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Since degree centrality accounts for the connections of the vertices, it can be used to see the influence a vertex has over the vertices in its immediate neighborhood.
- Parameters:
graph
- the graph.dc
- (out argument) vertex property holding the degree centrality value for each vertex in the graph.- Returns:
- vertex property holding the degree centrality value for each vertex in the graph.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Integer> dc = graph.createVertexProperty(PropertyType.INTEGER); PgxFuture<VertexProperty<Integer, Integer>> promise = analyst.degreeCentralityAsync(graph, dc); promise.thenCompose(degree -> graph.queryPgqlAsync( "SELECT x, x." + degree.getName() + " MATCH (x) ORDER BY x." + degree.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
degreeCentralityAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Integer>> degreeCentralityAsync(PgxGraph graph, java.lang.String propertyName)
-
harmonicCentralityAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> harmonicCentralityAsync(PgxGraph graph)
Harmonic centrality measures node importance by considering the reciprocal of the sum of shortest path distances in the network.
Definition
Harmonic centrality computes the centrality of each vertex by taking the reciprocal of the sum of the shortest path distances from that vertex to all other vertices in the graph. This metric highlights the importance of vertices that efficiently connect disparate parts of the network
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V * (V + E)) with V = number of vertices, E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Harmonic centrality can be applied in transportation networks to identify critical nodes that facilitate efficient travel between different destinations.
- Parameters:
graph
- the graph.- Returns:
- vertex property holding the harmonic centrality value for each vertex in the graph.
Examples
PgxGraph graph = ...; PgxFuture<VertexProperty<Long, Double>> promise = analyst.harmonicCentralityAsync(graph); promise.thenCompose(harmonicC -> graph.queryPgqlAsync( "SELECT x, x." + harmonicC.getName() + "FROM MATCH (x) ")) .thenAccept(PgqlResultSet::print);
- Time:
-
harmonicCentralityAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> harmonicCentralityAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> hc)
Harmonic centrality measures node importance by considering the reciprocal of the sum of shortest path distances in the network.
Definition
Harmonic centrality computes the centrality of each vertex by taking the reciprocal of the sum of the shortest path distances from that vertex to all other vertices in the graph. This metric highlights the importance of vertices that efficiently connect disparate parts of the network
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V * (V + E)) with V = number of vertices, E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Harmonic centrality can be applied in transportation networks to identify critical nodes that facilitate efficient travel between different destinations.
- Parameters:
graph
- the graph.hc
- (out argument) vertex property holding the harmonic centrality value for each vertex in the graph.- Returns:
- vertex property holding the harmonic centrality value for each vertex in the graph.
Examples
PgxGraph graph = ...; VertexProperty<Long, Double> hc = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Long, Double>> promise = analyst.harmonicCentralityAsync(graph, hc); promise.thenCompose(harmonicC -> graph.queryPgqlAsync( "SELECT x, x." + harmonicC.getName() + "FROM MATCH (x) ")) .thenAccept(PgqlResultSet::print);
- Time:
-
harmonicCentralityAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> harmonicCentralityAsync(PgxGraph graph, java.lang.String propertyName)
-
adamicAdarCountingAsync
public PgxFuture<EdgeProperty<java.lang.Double>> adamicAdarCountingAsync(PgxGraph graph)
The adamic-adar index compares the amount of neighbors shared between vertices, this measure can be used with communities.
Definition
The Adamic-Adar index is meant for undirected graphs, since it is computed using the degree of the shared neighbors by two vertices in the graph. This implementation is intended for undirected graphs and computes the index for every pair of vertices connected by an edge and associates it with that edge.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(E) with E = number of edges
- Space:
O(E) with E = number of edges
Default Values
Applications
- The Adamic-Adar index can be used to find correlations between groups of people in social networks, thus characterize communities and also infer potential new links between them.
- Parameters:
graph
- the graph.- Returns:
- edge property holding the Adamic-Adar index of each edge in the graph.
Examples
PgxGraph graph = ...; PgxFuture<EdgeProperty<Double>> promise = analyst.adamicAdarCountingAsync(graph); promise.thenCompose(adamicAdar -> graph.queryPgqlAsync( "SELECT x, x." + adamicAdar.getName() + " MATCH (x) ORDER BY x." + adamicAdar.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Link Prediction Problem for Social Networks.
- Time:
-
adamicAdarCountingAsync
public PgxFuture<EdgeProperty<java.lang.Double>> adamicAdarCountingAsync(PgxGraph graph, EdgeProperty<java.lang.Double> aa)
The adamic-adar index compares the amount of neighbors shared between vertices, this measure can be used with communities.
Definition
The Adamic-Adar index is meant for undirected graphs, since it is computed using the degree of the shared neighbors by two vertices in the graph. This implementation is intended for undirected graphs and computes the index for every pair of vertices connected by an edge and associates it with that edge.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(E) with E = number of edges
- Space:
O(E) with E = number of edges
Default Values
Applications
- The Adamic-Adar index can be used to find correlations between groups of people in social networks, thus characterize communities and also infer potential new links between them.
- Parameters:
graph
- the graph.aa
- (out argument) edge property holding the Adamic-Adar index of each edge in the graph.- Returns:
- edge property holding the Adamic-Adar index of each edge in the graph.
Examples
PgxGraph graph = ...; EdgeProperty<Double> aa = graph.createEdgeProperty(PropertyType.DOUBLE); PgxFuture<EdgeProperty<Double>> promise = analyst.adamicAdarCountingAsync(graph, aa); promise.thenCompose(adamicAdar -> graph.queryPgqlAsync( "SELECT x, x." + adamicAdar.getName() + " MATCH (x) ORDER BY x." + adamicAdar.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- The Link Prediction Problem for Social Networks.
- Time:
-
randomWalkWithRestartAsync
public <ID> PgxFuture<PgxMap<PgxVertex<ID>,java.lang.Integer>> randomWalkWithRestartAsync(PgxGraph graph, PgxVertex<ID> source, int length, double resetProb, PgxMap<PgxVertex<ID>,java.lang.Integer> visitCount)
random walk with restart does the what its name says, it can find approximate stationary distributions
Definition
This algorithm performs a random walk over the graph. The walk will start at the given source vertex and will randomly visit neighboring vertices in the graph, with a probability equal to the value of reset_probability of going back to the starting point. The random walk will also go back to the starting point every time it reaches a vertex with no outgoing edges. The algorithm will stop once it reaches the specified walk length.
Implementation Details
The implementation of this algorithm uses an iterative method. Since the algorithm visits the vertices in a random order on each iteration it is non-deterministic.
Complexity
- Time:
O(L) with L = length of the random walk
- Space:
O(V) with V = number of vertices
Default Values
Applications
- The information gathered from a random walk can be used to approximate stationary distributions when the number of visits is normalized
- Parameters:
graph
- the graph.source
- (in argument) starting point of the random walk.length
- (in argument) length (number of steps) of the random walk.resetProb
- (in argument) probability value for resetting the random walk.visitCount
- (out argument) map holding the number of visits during the random walk for each vertex in the graph.- Returns:
- map holding the number of visits during the random walk for each vertex in the graph.
Examples
PgxGraph graph = ...; PgxMap<PgxVertex, Integer> visit_count; PgxFuture<PgxMap<PgxVertex, Integer>> promise = analyst.randomWalkWithRestart(graph, 0, 100, 0,6, visit_count);
- See Also:
- Random Walks on Graphs: A Survey
- Time:
-
communitiesLabelPropagationAsync
public <ID> PgxFuture<Partition<ID>> communitiesLabelPropagationAsync(PgxGraph graph)
Label propagation can find communities in a graph relatively fast
Definition
Label Propagation is an algorithm designed to find community structures in a graph. It assigns a unique community label to each vertex in the graph, which then is updated on each iteration by looking and choosing the most frequent label amongst those from its neighbors. Convergence is achieved once the label of each vertex is the same as the most frequent one amongst its neighbors, i.e. when there are no changes in the communities assigned to the vertices in one iteration.
Implementation Details
The implementation of this algorithm uses an iterative method. Since the algorithm visits the vertices in a random order on each iteration it is non-deterministic.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
- max_iter: 100
Applications
- Community detection can be used for clustering and can be applied to the analysis of organization in real-world scenarios like groups of people in social networks.
- Parameters:
graph
- the graph.- Returns:
- Partition holding the node collections corresponding to the communities found by the algorithm.
Examples
PgxGraph graph = ...; PgxFuture<Partition<Integer>> promise = analyst.communitiesLabelPropagationAsync(graph); promise.thenCompose(conductance -> graph.queryPgqlAsync( "SELECT x, x." + conductance.getPropertyName() + " MATCH (x) ORDER BY x." + conductance.getPropertyName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
communitiesLabelPropagationAsync
public <ID> PgxFuture<Partition<ID>> communitiesLabelPropagationAsync(PgxGraph graph, int maxIterations)
Label propagation can find communities in a graph relatively fast
Definition
Label Propagation is an algorithm designed to find community structures in a graph. It assigns a unique community label to each vertex in the graph, which then is updated on each iteration by looking and choosing the most frequent label amongst those from its neighbors. Convergence is achieved once the label of each vertex is the same as the most frequent one amongst its neighbors, i.e. when there are no changes in the communities assigned to the vertices in one iteration.
Implementation Details
The implementation of this algorithm uses an iterative method. Since the algorithm visits the vertices in a random order on each iteration it is non-deterministic.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
- max_iter: 100
Applications
- Community detection can be used for clustering and can be applied to the analysis of organization in real-world scenarios like groups of people in social networks.
- Parameters:
graph
- the graph.maxIterations
- maximum number of iterations that will be performed.- Returns:
- Partition holding the node collections corresponding to the communities found by the algorithm.
Examples
PgxGraph graph = ...; PgxFuture<Partition<Integer>> promise = analyst.communitiesLabelPropagationAsync(graph, 100); promise.thenCompose(conductance -> graph.queryPgqlAsync( "SELECT x, x." + conductance.getPropertyName() + " MATCH (x) ORDER BY x." + conductance.getPropertyName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
communitiesLabelPropagationAsync
public <ID> PgxFuture<Partition<ID>> communitiesLabelPropagationAsync(PgxGraph graph, VertexProperty<ID,java.lang.Long> partitionDistribution)
Label propagation can find communities in a graph relatively fast
Definition
Label Propagation is an algorithm designed to find community structures in a graph. It assigns a unique community label to each vertex in the graph, which then is updated on each iteration by looking and choosing the most frequent label amongst those from its neighbors. Convergence is achieved once the label of each vertex is the same as the most frequent one amongst its neighbors, i.e. when there are no changes in the communities assigned to the vertices in one iteration.
Implementation Details
The implementation of this algorithm uses an iterative method. Since the algorithm visits the vertices in a random order on each iteration it is non-deterministic.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
- max_iter: 100
Applications
- Community detection can be used for clustering and can be applied to the analysis of organization in real-world scenarios like groups of people in social networks.
- Parameters:
graph
- the graph.partitionDistribution
- vertex property holding the label of the community assigned to each vertex.- Returns:
- Partition holding the node collections corresponding to the communities found by the algorithm.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Long> pd = graph.createVertexProperty(PropertyType.LONG); PgxFuture<Partition<Integer>> promise = analyst.communitiesLabelPropagationAsync(graph, pd); promise.thenCompose(conductance -> graph.queryPgqlAsync( "SELECT x, x." + conductance.getPropertyName() + " MATCH (x) ORDER BY x." + conductance.getPropertyName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
communitiesLabelPropagationAsync
public <ID> PgxFuture<Partition<ID>> communitiesLabelPropagationAsync(PgxGraph graph, int maxIterations, VertexProperty<ID,java.lang.Long> partitionDistribution)
Label propagation can find communities in a graph relatively fast
Definition
Label Propagation is an algorithm designed to find community structures in a graph. It assigns a unique community label to each vertex in the graph, which then is updated on each iteration by looking and choosing the most frequent label amongst those from its neighbors. Convergence is achieved once the label of each vertex is the same as the most frequent one amongst its neighbors, i.e. when there are no changes in the communities assigned to the vertices in one iteration.
Implementation Details
The implementation of this algorithm uses an iterative method. Since the algorithm visits the vertices in a random order on each iteration it is non-deterministic.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
- max_iter: 100
Applications
- Community detection can be used for clustering and can be applied to the analysis of organization in real-world scenarios like groups of people in social networks.
- Parameters:
graph
- the graph.maxIterations
- maximum number of iterations that will be performed.partitionDistribution
- vertex property holding the label of the community assigned to each vertex.- Returns:
- Partition holding the node collections corresponding to the communities found by the algorithm.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Long> pd = graph.createVertexProperty(PropertyType.LONG); PgxFuture<Partition<Integer>> promise = analyst.communitiesLabelPropagationAsync(graph, 100, pd); promise.thenCompose(conductance -> graph.queryPgqlAsync( "SELECT x, x." + conductance.getPropertyName() + " MATCH (x) ORDER BY x." + conductance.getPropertyName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
communitiesConductanceMinimizationAsync
public <ID> PgxFuture<Partition<ID>> communitiesConductanceMinimizationAsync(PgxGraph graph)
Soman and Narang can find communities in a graph taking weighted edges into account
Definition
The algorithm proposed by Soman and Narang to find community structures in a graph can be regarded as a variant of the label propagation algorithm, since it takes into account weights over the edges when looking for the community assignments. This implementation generates the weight of the edges by using the triangles in the graph, and just like label propagation, it assigns a unique community label to each vertex in the graph at the beginning, which is then updated on each iteration by looking and choosing the most frequent label from the labels of their neighbors. Convergence is achieved once the label of each vertex is the same as the most frequent one amongst its neighbors, i.e. when there are no changes in the communities assigned to the vertices in one iteration.
Implementation Details
The implementation of this algorithm uses an iterative method. Since the algorithm visits the vertices in a random order on each iteration it is non-deterministic. Also note that there is a possibility of constant vertex swapping. For example, if you have two vertices A and B in your graph. It can happen that A will acquire the community of B but at the same time B will acquire the community of A. That is why you should set a maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(5 * V + 2 * E) with V = number of vertices, E = number of edges
Default Values
- max_iter: 100
Applications
- Community detection can be used for clustering and can be applied to the analysis of organization in real-world scenarios like groups of people in social networks.
- Parameters:
graph
- the graph.- Returns:
- Partition holding the node collections corresponding to the communities found by the algorithm.
Examples
PgxGraph graph = ...; PgxFuture<Partition<Integer>> promise = analyst.communitiesConductanceMinimizationAsync(graph); promise.thenCompose(conductance -> graph.queryPgqlAsync( "SELECT x, x." + conductance.getPropertyName() + " MATCH (x) ORDER BY x." + conductance.getPropertyName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
communitiesConductanceMinimizationAsync
public <ID> PgxFuture<Partition<ID>> communitiesConductanceMinimizationAsync(PgxGraph graph, int max)
Soman and Narang can find communities in a graph taking weighted edges into account
Definition
The algorithm proposed by Soman and Narang to find community structures in a graph can be regarded as a variant of the label propagation algorithm, since it takes into account weights over the edges when looking for the community assignments. This implementation generates the weight of the edges by using the triangles in the graph, and just like label propagation, it assigns a unique community label to each vertex in the graph at the beginning, which is then updated on each iteration by looking and choosing the most frequent label from the labels of their neighbors. Convergence is achieved once the label of each vertex is the same as the most frequent one amongst its neighbors, i.e. when there are no changes in the communities assigned to the vertices in one iteration.
Implementation Details
The implementation of this algorithm uses an iterative method. Since the algorithm visits the vertices in a random order on each iteration it is non-deterministic. Also note that there is a possibility of constant vertex swapping. For example, if you have two vertices A and B in your graph. It can happen that A will acquire the community of B but at the same time B will acquire the community of A. That is why you should set a maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(5 * V + 2 * E) with V = number of vertices, E = number of edges
Default Values
- max_iter: 100
Applications
- Community detection can be used for clustering and can be applied to the analysis of organization in real-world scenarios like groups of people in social networks.
- Parameters:
graph
- the graph.max
- maximum number of iterations that will be performed. For most graphs, a maximum of 100 iterations should be enough.- Returns:
- Partition holding the node collections corresponding to the communities found by the algorithm.
Examples
PgxGraph graph = ...; PgxFuture<Partition<Integer>> promise = analyst.communitiesConductanceMinimizationAsync(graph, 100); promise.thenCompose(conductance -> graph.queryPgqlAsync( "SELECT x, x." + conductance.getPropertyName() + " MATCH (x) ORDER BY x." + conductance.getPropertyName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
communitiesConductanceMinimizationAsync
public <ID> PgxFuture<Partition<ID>> communitiesConductanceMinimizationAsync(PgxGraph graph, VertexProperty<ID,java.lang.Long> partitionDistribution)
Soman and Narang can find communities in a graph taking weighted edges into account
Definition
The algorithm proposed by Soman and Narang to find community structures in a graph can be regarded as a variant of the label propagation algorithm, since it takes into account weights over the edges when looking for the community assignments. This implementation generates the weight of the edges by using the triangles in the graph, and just like label propagation, it assigns a unique community label to each vertex in the graph at the beginning, which is then updated on each iteration by looking and choosing the most frequent label from the labels of their neighbors. Convergence is achieved once the label of each vertex is the same as the most frequent one amongst its neighbors, i.e. when there are no changes in the communities assigned to the vertices in one iteration.
Implementation Details
The implementation of this algorithm uses an iterative method. Since the algorithm visits the vertices in a random order on each iteration it is non-deterministic. Also note that there is a possibility of constant vertex swapping. For example, if you have two vertices A and B in your graph. It can happen that A will acquire the community of B but at the same time B will acquire the community of A. That is why you should set a maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(5 * V + 2 * E) with V = number of vertices, E = number of edges
Default Values
- max_iter: 100
Applications
- Community detection can be used for clustering and can be applied to the analysis of organization in real-world scenarios like groups of people in social networks.
- Parameters:
graph
- the graph.partitionDistribution
- vertex property holding the label of the community assigned to each vertex.- Returns:
- Partition holding the node collections corresponding to the communities found by the algorithm.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Long> pd = graph.createVertexProperty(PropertyType.LONG); PgxFuture<Partition<Integer>> promise = analyst.communitiesConductanceMinimizationAsync(graph, pd); promise.thenCompose(conductance -> graph.queryPgqlAsync( "SELECT x, x." + conductance.getPropertyName() + " MATCH (x) ORDER BY x." + conductance.getPropertyName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
communitiesConductanceMinimizationAsync
public <ID> PgxFuture<Partition<ID>> communitiesConductanceMinimizationAsync(PgxGraph graph, int maxIterations, VertexProperty<ID,java.lang.Long> partitionDistribution)
Soman and Narang can find communities in a graph taking weighted edges into account
Definition
The algorithm proposed by Soman and Narang to find community structures in a graph can be regarded as a variant of the label propagation algorithm, since it takes into account weights over the edges when looking for the community assignments. This implementation generates the weight of the edges by using the triangles in the graph, and just like label propagation, it assigns a unique community label to each vertex in the graph at the beginning, which is then updated on each iteration by looking and choosing the most frequent label from the labels of their neighbors. Convergence is achieved once the label of each vertex is the same as the most frequent one amongst its neighbors, i.e. when there are no changes in the communities assigned to the vertices in one iteration.
Implementation Details
The implementation of this algorithm uses an iterative method. Since the algorithm visits the vertices in a random order on each iteration it is non-deterministic. Also note that there is a possibility of constant vertex swapping. For example, if you have two vertices A and B in your graph. It can happen that A will acquire the community of B but at the same time B will acquire the community of A. That is why you should set a maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(5 * V + 2 * E) with V = number of vertices, E = number of edges
Default Values
- max_iter: 100
Applications
- Community detection can be used for clustering and can be applied to the analysis of organization in real-world scenarios like groups of people in social networks.
- Parameters:
graph
- the graph.maxIterations
- maximum number of iterations that will be performed. For most graphs, a maximum of 100 iterations should be enough.partitionDistribution
- vertex property holding the label of the community assigned to each vertex.- Returns:
- Partition holding the node collections corresponding to the communities found by the algorithm.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Long> pd = graph.createVertexProperty(PropertyType.LONG); PgxFuture<Partition<Integer>> promise = analyst.communitiesConductanceMinimizationAsync(graph, 100, pd); promise.thenCompose(conductance -> graph.queryPgqlAsync( "SELECT x, x." + conductance.getPropertyName() + " MATCH (x) ORDER BY x." + conductance.getPropertyName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
communitiesInfomapAsync
public <ID> PgxFuture<Partition<ID>> communitiesInfomapAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> rank, EdgeProperty<java.lang.Double> weight)
Infomap can find high quality communities in a graph.
Definition
Infomap is a robust algorithm designed to find community structures in a graph that requires some pre-processing steps. This implementation needs a reciprocated or an undirected graph, as well as the ranking score from the normalized weighted version of the Pagerank algorithm. It will assign a unique module (or community) label to each vertex in the graph based on their Pagerank score, edge weights and the labels of their neighbors. It is an iterative algorithm that updates the labels of the vertices in random order on each iteration using the previous factors, converging once there are no further changes in the vertex labels, or once the maximum number of iterations is reached. The algorithm is non-deterministic because of the random order for visiting and updating the vertex labels, thus the communities found might be different each time the algorithm is run.
Implementation Details
The implementation of this algorithm uses an iterative method. Since the algorithm visits the vertices in a random order on each iteration it is non-deterministic. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O((k ^ 2) * E) with E = number of edges, k <= maximum number of iterations
- Space:
O(10 * V + 2 * E) with V = number of vertices, E = number of edges
Default Values
- max_iter: 100
Applications
- Community detection can be used for clustering and can be applied to the analysis of organization in real-world scenarios like groups of people in social networks.
- Parameters:
graph
- the undirected graph.rank
- vertex property holding the normalized (weighted) PageRank value for each vertex (a value between 0 and 1).weight
- edge property holding the weight of each edge in the graph.- Returns:
- Partition holding the node collections corresponding to the communities found by the algorithm.
Examples
PgxGraph graph = ...; EdgeProperty<Double> weight = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> rank = analyst.weightedPagerank(graph, 1e-16, 0.85, 1000, true, weight); VertexProperty<Integer, Long> module = graph.createVertexProperty(PropertyType.LONG); PgxFuture<Partition<Integer>> promise = analyst.communitiesInfomapAsync(graph, rank, weight); partition = promise.get() first_component = partition.getPartitionByIndex(0)
- Time:
-
communitiesInfomapAsync
public <ID> PgxFuture<Partition<ID>> communitiesInfomapAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> rank, EdgeProperty<java.lang.Double> weight, double tau, double tol, int maxIter)
Infomap can find high quality communities in a graph.
Definition
Infomap is a robust algorithm designed to find community structures in a graph that requires some pre-processing steps. This implementation needs a reciprocated or an undirected graph, as well as the ranking score from the normalized weighted version of the Pagerank algorithm. It will assign a unique module (or community) label to each vertex in the graph based on their Pagerank score, edge weights and the labels of their neighbors. It is an iterative algorithm that updates the labels of the vertices in random order on each iteration using the previous factors, converging once there are no further changes in the vertex labels, or once the maximum number of iterations is reached. The algorithm is non-deterministic because of the random order for visiting and updating the vertex labels, thus the communities found might be different each time the algorithm is run.
Implementation Details
The implementation of this algorithm uses an iterative method. Since the algorithm visits the vertices in a random order on each iteration it is non-deterministic. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O((k ^ 2) * E) with E = number of edges, k <= maximum number of iterations
- Space:
O(10 * V + 2 * E) with V = number of vertices, E = number of edges
Default Values
- max_iter: 100
Applications
- Community detection can be used for clustering and can be applied to the analysis of organization in real-world scenarios like groups of people in social networks.
- Parameters:
graph
- the undirected graph.rank
- vertex property holding the normalized (weighted) PageRank value for each vertex (a value between 0 and 1).weight
- edge property holding the weight of each edge in the graph.tau
- damping factor.tol
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.maxIter
- maximum number of iterations that will be performed.- Returns:
- Partition holding the node collections corresponding to the communities found by the algorithm.
Examples
PgxGraph graph = ...; EdgeProperty<Double> weight = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> rank = analyst.weightedPagerank(graph, 1e-16, 0.85, 1000, true, weight); VertexProperty<Integer, Long> module = graph.createVertexProperty(PropertyType.LONG); PgxFuture<Partition<Integer>> promise = analyst.communitiesInfomapAsync(graph, rank, weight, 0.15, 0.0001, 10); partition = promise.get() first_component = partition.getPartitionByIndex(0)
- Time:
-
communitiesInfomapAsync
public <ID> PgxFuture<Partition<ID>> communitiesInfomapAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> rank, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Long> module)
Infomap can find high quality communities in a graph.
Definition
Infomap is a robust algorithm designed to find community structures in a graph that requires some pre-processing steps. This implementation needs a reciprocated or an undirected graph, as well as the ranking score from the normalized weighted version of the Pagerank algorithm. It will assign a unique module (or community) label to each vertex in the graph based on their Pagerank score, edge weights and the labels of their neighbors. It is an iterative algorithm that updates the labels of the vertices in random order on each iteration using the previous factors, converging once there are no further changes in the vertex labels, or once the maximum number of iterations is reached. The algorithm is non-deterministic because of the random order for visiting and updating the vertex labels, thus the communities found might be different each time the algorithm is run.
Implementation Details
The implementation of this algorithm uses an iterative method. Since the algorithm visits the vertices in a random order on each iteration it is non-deterministic. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O((k ^ 2) * E) with E = number of edges, k <= maximum number of iterations
- Space:
O(10 * V + 2 * E) with V = number of vertices, E = number of edges
Default Values
- max_iter: 100
Applications
- Community detection can be used for clustering and can be applied to the analysis of organization in real-world scenarios like groups of people in social networks.
- Parameters:
graph
- the undirected graph.rank
- vertex property holding the normalized (weighted) PageRank value for each vertex (a value between 0 and 1).weight
- edge property holding the weight of each edge in the graph.module
- vertex property holding the label of the community assigned to each vertex.- Returns:
- Partition holding the node collections corresponding to the communities found by the algorithm.
Examples
PgxGraph graph = ...; EdgeProperty<Double> weight = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> rank = analyst.weightedPagerank(graph, 1e-16, 0.85, 1000, true, weight); VertexProperty<Integer, Long> module = graph.createVertexProperty(PropertyType.LONG); PgxFuture<Partition<Integer>> promise = analyst.communitiesInfomapAsync(graph, rank, weight, module); partition = promise.get() first_component = partition.getPartitionByIndex(0)
- Time:
-
communitiesInfomapAsync
public <ID> PgxFuture<Partition<ID>> communitiesInfomapAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> rank, EdgeProperty<java.lang.Double> weight, double tau, double tol, int maxIter, VertexProperty<ID,java.lang.Long> module)
Infomap can find high quality communities in a graph.
Definition
Infomap is a robust algorithm designed to find community structures in a graph that requires some pre-processing steps. This implementation needs a reciprocated or an undirected graph, as well as the ranking score from the normalized weighted version of the Pagerank algorithm. It will assign a unique module (or community) label to each vertex in the graph based on their Pagerank score, edge weights and the labels of their neighbors. It is an iterative algorithm that updates the labels of the vertices in random order on each iteration using the previous factors, converging once there are no further changes in the vertex labels, or once the maximum number of iterations is reached. The algorithm is non-deterministic because of the random order for visiting and updating the vertex labels, thus the communities found might be different each time the algorithm is run.
Implementation Details
The implementation of this algorithm uses an iterative method. Since the algorithm visits the vertices in a random order on each iteration it is non-deterministic. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O((k ^ 2) * E) with E = number of edges, k <= maximum number of iterations
- Space:
O(10 * V + 2 * E) with V = number of vertices, E = number of edges
Default Values
- max_iter: 100
Applications
- Community detection can be used for clustering and can be applied to the analysis of organization in real-world scenarios like groups of people in social networks.
- Parameters:
graph
- the undirected graph.rank
- vertex property holding the normalized (weighted) PageRank value for each vertex (a value between 0 and 1).weight
- edge property holding the weight of each edge in the graph.tau
- damping factor.tol
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.maxIter
- maximum number of iterations that will be performed.module
- vertex property holding the label of the community assigned to each vertex.- Returns:
- Partition holding the node collections corresponding to the communities found by the algorithm.
Examples
PgxGraph graph = ...; EdgeProperty<Double> weight = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> rank = analyst.weightedPagerank(graph, 1e-16, 0.85, 1000, true, weight); VertexProperty<Integer, Long> module = graph.createVertexProperty(PropertyType.LONG); PgxFuture<Partition<Integer>> promise = analyst.communitiesInfomapAsync(graph, rank, weight, 0.15, 0.0001, 10, module); partition = promise.get() first_component = partition.getPartitionByIndex(0)
- Time:
-
louvainAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Long>> louvainAsync(PgxGraph graph, EdgeProperty<java.lang.Double> weight, int maxIter, int nbrPass, double tol, VertexProperty<ID,java.lang.Long> community)
Louvain can detect communities in a large graph relatively fast.
Definition
Louvain is an algorithm for community detection in large graphs which uses the graph's modularity. Initially it assigns a different community to each node of the graph. It then iterates over the nodes and evaluates for each node the modularity gain obtained by removing the node from its community and placing it in the community of one of its neighbors. The node is placed in the community for which the modularity gain is maximum. This process is repeated for all nodes until no improvement is possible, i.e until no new assignment of a node to a different community can improve the graph's modularity.
Implementation Details
The implementation of this algorithm uses an iterative method.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(8 * V + E) with V = number of vertices
Default Values
Applications
- The Louvain algorithm can be used for community detection in a multiple real-life situations, like identifying cyber-communities in a social network.
- Parameters:
graph
- the graph.weight
- weights of the edges of the graph.maxIter
- maximum number of iterations that will be performed during each pass.nbrPass
- number of passes that will be performed.tol
- maximum tolerated error value. The algorithm will stop once the graph's total modularity gain becomes smaller than this value.community
- the community ID assigned to each node.- Returns:
- the community ID assigned to each node.
Examples
PgxGraph graph = ...; EdgeProperty<Double> weight = graph.getEdgeProperty("cost"); VertexProperty<Long, Long> community = graph.createVertexProperty(PropertyType.LONG,"COMMUNITY"); var result= analyst.louvain(graph, weight, 100, 10, 0.001, community);
- Time:
-
louvainAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Long>> louvainAsync(PgxGraph graph, EdgeProperty<java.lang.Double> weight, int maxIter)
Louvain can detect communities in a large graph relatively fast.
Definition
Louvain is an algorithm for community detection in large graphs which uses the graph's modularity. Initially it assigns a different community to each node of the graph. It then iterates over the nodes and evaluates for each node the modularity gain obtained by removing the node from its community and placing it in the community of one of its neighbors. The node is placed in the community for which the modularity gain is maximum. This process is repeated for all nodes until no improvement is possible, i.e until no new assignment of a node to a different community can improve the graph's modularity.
Implementation Details
The implementation of this algorithm uses an iterative method.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(8 * V + E) with V = number of vertices
Default Values
Applications
- The Louvain algorithm can be used for community detection in a multiple real-life situations, like identifying cyber-communities in a social network.
- Parameters:
graph
- the graph.weight
- weights of the edges of the graph.maxIter
- maximum number of iterations that will be performed during each pass.- Returns:
- the community ID assigned to each node.
Examples
PgxGraph graph = ...; EdgeProperty<Double> weight = graph.getEdgeProperty("cost"); VertexProperty<Long, Long> community = analyst.louvain(graph, weight, 100);
- Time:
-
louvainAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Long>> louvainAsync(PgxGraph graph, EdgeProperty<java.lang.Double> weight)
Louvain can detect communities in a large graph relatively fast.
Definition
Louvain is an algorithm for community detection in large graphs which uses the graph's modularity. Initially it assigns a different community to each node of the graph. It then iterates over the nodes and evaluates for each node the modularity gain obtained by removing the node from its community and placing it in the community of one of its neighbors. The node is placed in the community for which the modularity gain is maximum. This process is repeated for all nodes until no improvement is possible, i.e until no new assignment of a node to a different community can improve the graph's modularity.
Implementation Details
The implementation of this algorithm uses an iterative method.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(8 * V + E) with V = number of vertices
Default Values
Applications
- The Louvain algorithm can be used for community detection in a multiple real-life situations, like identifying cyber-communities in a social network.
- Parameters:
graph
- the graph.weight
- weights of the edges of the graph.- Returns:
- the community ID assigned to each node.
Examples
PgxGraph graph = ...; EdgeProperty<Double> weight = graph.getEdgeProperty("cost"); VertexProperty<Long, Long> community = analyst.louvain(graph, weight);
- Time:
-
speakerListenerLabelPropagationAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.String>> speakerListenerLabelPropagationAsync(PgxGraph graph, java.lang.String labelsPropName)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.
Definition
The speaker listener label propagation algorithm is an extension of the label propagation algorithm, which is able to detect overlapping communities.
Implementation Details
null
Complexity
- Time:
O(max_iter * N) with N = number of neighbors of vertex1, max_iter = number of iterations
- Space:
O(N + V * max_iter) with N = number of neighbors of vertex1, max_iter = number of iterations
Default Values
- max_iter: 100
- threshold: 0.0
- delimiter: |
Applications
- Parameters:
graph
- the graph.labelsPropName
- The name of the string property.- Returns:
- distinct vertex labels which meet the threshold parameter.
Examples
PgxGraph graph = ...; String labelsPropname="O___"; PgxFuture<VertexProperty<ID, String>> resultProp = analyst.speakerListenerLabelPropagationAsync(graph, labelsPropName);
- Time:
-
speakerListenerLabelPropagationAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.String>> speakerListenerLabelPropagationAsync(PgxGraph graph, java.lang.String labelsPropName, int maxIter, double threshold, java.lang.String delimiter)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.
Definition
The speaker listener label propagation algorithm is an extension of the label propagation algorithm, which is able to detect overlapping communities.
Implementation Details
null
Complexity
- Time:
O(max_iter * N) with N = number of neighbors of vertex1, max_iter = number of iterations
- Space:
O(N + V * max_iter) with N = number of neighbors of vertex1, max_iter = number of iterations
Default Values
- max_iter: 100
- threshold: 0.0
- delimiter: |
Applications
- Parameters:
graph
- the graph.labelsPropName
- The name of the string property.maxIter
- number of iterations.threshold
- minimum frequency for a label to retain a vertex.delimiter
- string delimiter for labels.- Returns:
- distinct vertex labels which meet the threshold parameter.
Examples
PgxGraph graph = ...; String labelsPropname="O___"; int maxIter = 100; double threshold = 0.2; String delimiter = "|"; PgxFuture<VertexProperty<ID, String>> resultProp = analyst.speakerListenerLabelPropagationAsync(graph, maxIter, threshold, delimiter, memPropName, labelsPropName);
- Time:
-
speakerListenerLabelPropagationAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.String>> speakerListenerLabelPropagationAsync(PgxGraph graph, VertexProperty<ID,java.lang.String> labels, int maxIter, double threshold, java.lang.String delimiter)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.
Definition
The speaker listener label propagation algorithm is an extension of the label propagation algorithm, which is able to detect overlapping communities.
Implementation Details
null
Complexity
- Time:
O(max_iter * N) with N = number of neighbors of vertex1, max_iter = number of iterations
- Space:
O(N + V * max_iter) with N = number of neighbors of vertex1, max_iter = number of iterations
Default Values
- max_iter: 100
- threshold: 0.0
- delimiter: |
Applications
- Parameters:
graph
- the graph.labels
- distinct vertex labels which meet the threshold parameter.maxIter
- number of iterations.threshold
- minimum frequency for a label to retain a vertex.delimiter
- string delimiter for labels.- Returns:
- distinct vertex labels which meet the threshold parameter.
Examples
PgxGraph graph = ...; VertexProperty<ID, String> labels = graph.createVertexProperty(PropertyType.STRING); int maxIter = 100; double threshold = 0.2; String delimiter = "|"; PgxFuture<VertexProperty<ID, String>> labels = analyst.speakerListenerLabelPropagationAsync(graph, labels, maxIter, threshold, delimiter);
- Time:
-
weightedSpeakerListenerLabelPropagationAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.String>> weightedSpeakerListenerLabelPropagationAsync(PgxGraph graph, VertexProperty<ID,java.lang.String> labels, int maxIter, double threshold, java.lang.String delimiter, EdgeProperty<java.lang.Double> weight)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.
Definition
The speaker listener label propagation algorithm is an extension of the label propagation algorithm, which is able to detect overlapping communities. This variant uses the edges weight to find those communities.
Implementation Details
null
Complexity
- Time:
O(max_iter * N) with N = number of neighbors of vertex1, max_iter = number of iterations
- Space:
O(N + V * max_iter) with N = number of neighbors of vertex1, max_iter = number of iterations
Default Values
- max_iter: 100
- threshold: 0.0
- delimiter: |
Applications
- Parameters:
graph
- the graph.labels
-maxIter
- number of iterations.threshold
- minimum frequency for a label to retain a vertex.delimiter
- string delimiter for labels.weight
- edge property holding the weight of each edge in the graph.- Returns:
-
Examples
PgxGraph graph = ...; VertexProperty<ID, String> labels = graph.createVertexProperty(PropertyType.STRING); EdgeProperty<Double> weight = graph.getEdgeProperty("weight"); int maxIter = 100; double threshold = 0.2; String delimiter = "|"; PgxFuture<VertexProperty<ID, String>> labels = analyst.weightedSpeakerListenerLabelPropagationAsync(graph, labels, maxIter, threshold, delimiter, weight);
- Time:
-
weightedSpeakerListenerLabelPropagationAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.String>> weightedSpeakerListenerLabelPropagationAsync(PgxGraph graph, java.lang.String labelsPropName, int maxIter, double threshold, java.lang.String delimiter, EdgeProperty<java.lang.Double> weight)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.
Definition
The speaker listener label propagation algorithm is an extension of the label propagation algorithm, which is able to detect overlapping communities. This variant uses the edges weight to find those communities.
Implementation Details
null
Complexity
- Time:
O(max_iter * N) with N = number of neighbors of vertex1, max_iter = number of iterations
- Space:
O(N + V * max_iter) with N = number of neighbors of vertex1, max_iter = number of iterations
Default Values
- max_iter: 100
- threshold: 0.0
- delimiter: |
Applications
- Parameters:
graph
- the graph.labelsPropName
- The name of the string property.maxIter
- number of iterations.threshold
- minimum frequency for a label to retain a vertex.delimiter
- string delimiter for labels.weight
- edge property holding the weight of each edge in the graph.- Returns:
-
Examples
PgxGraph graph = ...; EdgeProperty<Double> weight = graph.getEdgeProperty("weight"); String labelsPropname="O___"; int maxIter = 100; double threshold = 0.2; String delimiter = "|"; PgxFuture<VertexProperty<ID, String>> resultProp = analyst.weightedSpeakerListenerLabelPropagationAsync(graph, labelsPropName, maxIter, threshold, delimiter, weight);
- Time:
-
weightedSpeakerListenerLabelPropagationAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.String>> weightedSpeakerListenerLabelPropagationAsync(PgxGraph graph, java.lang.String labelsPropName, EdgeProperty<java.lang.Double> weight)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.
Definition
The speaker listener label propagation algorithm is an extension of the label propagation algorithm, which is able to detect overlapping communities. This variant uses the edges weight to find those communities.
Implementation Details
null
Complexity
- Time:
O(max_iter * N) with N = number of neighbors of vertex1, max_iter = number of iterations
- Space:
O(N + V * max_iter) with N = number of neighbors of vertex1, max_iter = number of iterations
Default Values
- max_iter: 100
- threshold: 0.0
- delimiter: |
Applications
- Parameters:
graph
- the graph.labelsPropName
- The name of the string property.weight
- edge property holding the weight of each edge in the graph.- Returns:
-
Examples
PgxGraph graph = ...; EdgeProperty<Double> weight = graph.getEdgeProperty("weight"); String labelsPropname="O___"; PgxFuture<VertexProperty<ID, String>> resultProp = analyst.weightedSpeakerListenerLabelPropagationAsync(graph, labelsPropName, weight);
- Time:
-
filteredSpeakerListenerLabelPropagationAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.String>> filteredSpeakerListenerLabelPropagationAsync(PgxGraph graph, VertexProperty<ID,java.lang.String> labels, int maxIter, double threshold, java.lang.String delimiter, EdgeFilter filter)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.
Definition
The speaker listener label propagation algorithm is an extension of the label propagation algorithm, which is able to detect overlapping communities. This variant utilizes an edge filter to select which neighbors to listen to.
Implementation Details
null
Complexity
- Time:
O(max_iter * N) with N = number of neighbors of vertex1, max_iter = number of iterations
- Space:
O(N + V * max_iter) with N = number of neighbors of vertex1, max_iter = number of iterations
Default Values
- max_iter: 100
- threshold: 0.0
- delimiter: |
Applications
- Parameters:
graph
-labels
-maxIter
-threshold
-delimiter
-filter
-- Returns:
-
Examples
PgxGraph graph = ...; VertexProperty<ID, String> labels = graph.createVertexProperty(PropertyType.STRING); EdgeFilter filter = EdgeFilter.fromExpression("edge.weight > 2.7"); int maxIter = 100; double threshold = 0.2; String delimiter = "|"; PgxFuture<VertexProperty<ID, String>> labels = analyst.filteredSpeakerListenerLabelPropagationAsync(graph, labels, maxIter, threshold, delimiter, filter);
- Time:
-
filteredSpeakerListenerLabelPropagationAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.String>> filteredSpeakerListenerLabelPropagationAsync(PgxGraph graph, java.lang.String labelsPropName, int maxIter, double threshold, java.lang.String delimiter, EdgeFilter filter)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.
Definition
The speaker listener label propagation algorithm is an extension of the label propagation algorithm, which is able to detect overlapping communities. This variant utilizes an edge filter to select which neighbors to listen to.
Implementation Details
null
Complexity
- Time:
O(max_iter * N) with N = number of neighbors of vertex1, max_iter = number of iterations
- Space:
O(N + V * max_iter) with N = number of neighbors of vertex1, max_iter = number of iterations
Default Values
- max_iter: 100
- threshold: 0.0
- delimiter: |
Applications
- Parameters:
graph
-labelsPropName
- The name of the string property.maxIter
-threshold
-delimiter
-filter
-- Returns:
-
Examples
PgxGraph graph = ...; String labelsPropname="O___"; EdgeFilter filter = EdgeFilter.fromExpression("edge.weight > 2.7"); int maxIter = 100; double threshold = 0.2; String delimiter = "|"; PgxFuture<VertexProperty<ID, String>> labels = analyst.filteredSpeakerListenerLabelPropagationAsync(graph, labelsPropName, maxIter, threshold, delimiter, filter);
- Time:
-
filteredSpeakerListenerLabelPropagationAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.String>> filteredSpeakerListenerLabelPropagationAsync(PgxGraph graph, java.lang.String labelsPropName, EdgeFilter filter)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.
Definition
The speaker listener label propagation algorithm is an extension of the label propagation algorithm, which is able to detect overlapping communities. This variant utilizes an edge filter to select which neighbors to listen to.
Implementation Details
null
Complexity
- Time:
O(max_iter * N) with N = number of neighbors of vertex1, max_iter = number of iterations
- Space:
O(N + V * max_iter) with N = number of neighbors of vertex1, max_iter = number of iterations
Default Values
- max_iter: 100
- threshold: 0.0
- delimiter: |
Applications
- Parameters:
graph
-labelsPropName
- The name of the string property.filter
-- Returns:
-
Examples
PgxGraph graph = ...; EdgeFilter filter = EdgeFilter.fromExpression("edge.weight > 2.7"); String labelsPropname="O___"; PgxFuture<VertexProperty<ID, String>> resultProp = analyst.filteredSpeakerListenerLabelPropagationAsync(graph, labelsPropName, filter);
- Time:
-
filteredWeightedSpeakerListenerLabelPropagationAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.String>> filteredWeightedSpeakerListenerLabelPropagationAsync(PgxGraph graph, VertexProperty<ID,java.lang.String> labels, int maxIter, double threshold, java.lang.String delimiter, EdgeProperty<java.lang.Double> weight, EdgeFilter filter)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.
Definition
The speaker listener label propagation algorithm is an extension of the label propagation algorithm, which is able to detect overlapping communities. This variant utilizes an edge filter to select which neighbors to listen to and uses the edges' weight to update the frequency of listened labels.
Implementation Details
null
Complexity
- Time:
O(max_iter * N) with N = number of neighbors of vertex1, max_iter = number of iterations
- Space:
O(N + V * max_iter) with N = number of neighbors of vertex1, max_iter = number of iterations
Default Values
- max_iter: 100
- threshold: 0.0
- delimiter: |
Applications
- Parameters:
graph
-labels
-maxIter
-threshold
-delimiter
-weight
-filter
-- Returns:
-
Examples
PgxGraph graph = ...; VertexProperty<ID, String> labels = graph.createVertexProperty(PropertyType.STRING); EdgeFilter filter = EdgeFilter.fromExpression("edge.weight > 3.0"); EdgeProperty<Double> weight = graph.getEdgeProperty("weight"); int maxIter = 100; double threshold = 0.2; String delimiter = "|"; PgxFuture<VertexProperty<ID, String>> labels = analyst.filteredWeightedSpeakerListenerLabelPropagationAsync(graph, labels, maxIter, threshold, delimiter, weight, filter);
- Time:
-
filteredWeightedSpeakerListenerLabelPropagationAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.String>> filteredWeightedSpeakerListenerLabelPropagationAsync(PgxGraph graph, java.lang.String labelsPropName, int maxIter, double threshold, java.lang.String delimiter, EdgeProperty<java.lang.Double> weight, EdgeFilter filter)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.
Definition
The speaker listener label propagation algorithm is an extension of the label propagation algorithm, which is able to detect overlapping communities. This variant utilizes an edge filter to select which neighbors to listen to and uses the edges' weight to update the frequency of listened labels.
Implementation Details
null
Complexity
- Time:
O(max_iter * N) with N = number of neighbors of vertex1, max_iter = number of iterations
- Space:
O(N + V * max_iter) with N = number of neighbors of vertex1, max_iter = number of iterations
Default Values
- max_iter: 100
- threshold: 0.0
- delimiter: |
Applications
- Parameters:
graph
-labelsPropName
- The name of the string property.maxIter
-threshold
-delimiter
-weight
-filter
-- Returns:
-
Examples
PgxGraph graph = ...; EdgeProperty<Double> weight = graph.getEdgeProperty("weight"); EdgeFilter filter = EdgeFilter.fromExpression("edge.weight > 3.0"); String labelsPropname="O___"; int maxIter = 100; double threshold = 0.2; String delimiter = "|"; PgxFuture<VertexProperty<ID, String>> resultProp = analyst.filteredWeightedSpeakerListenerLabelPropagationAsync( graph, labelsPropName, maxIter, threshold, delimiter, weight, filter);
- Time:
-
filteredWeightedSpeakerListenerLabelPropagationAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.String>> filteredWeightedSpeakerListenerLabelPropagationAsync(PgxGraph graph, java.lang.String labelsPropName, EdgeProperty<java.lang.Double> weight, EdgeFilter filter)
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.
Definition
The speaker listener label propagation algorithm is an extension of the label propagation algorithm, which is able to detect overlapping communities. This variant utilizes an edge filter to select which neighbors to listen to and uses the edges' weight to update the frequency of listened labels.
Implementation Details
null
Complexity
- Time:
O(max_iter * N) with N = number of neighbors of vertex1, max_iter = number of iterations
- Space:
O(N + V * max_iter) with N = number of neighbors of vertex1, max_iter = number of iterations
Default Values
- max_iter: 100
- threshold: 0.0
- delimiter: |
Applications
- Parameters:
graph
-labelsPropName
- The name of the string property.weight
-filter
-- Returns:
-
Examples
PgxGraph graph = ...; EdgeProperty<Double> weight = graph.getEdgeProperty("weight"); EdgeFilter filter = EdgeFilter.fromExpression("edge.weight > 3.0"); String labelsPropname="O___"; PgxFuture<VertexProperty<ID, String>> resultProp = analyst.filteredWeightedSpeakerListenerLabelPropagationAsync( graph, labelsPropName, weight, filter);
- Time:
-
conductanceAsync
public <ID> PgxFuture<Scalar<java.lang.Double>> conductanceAsync(PgxGraph graph, Partition<ID> partition, long partitionIndex)
Conductance assesses the quality of a partition in a graph
Definition
Conductance in a graph is computed for a specific cut of it. A cut is a partition of the graph into two subsets (components), disconnecting the graph if the edges from the cut are removed. Thus the algorithm requires a labeling for the vertices in the different subsets of the graph, then the conductance is computed by the ratio of the edges belonging to the given cut (i.e. the edges that split the graph into disconnected components) and the edges belonging to each of these subsets. If there is more than one cut (or partition), this implementation will take the given component number as reference to compute the conductance associated with that particular cut.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V) with V = number of vertices
- Space:
O(1)
Default Values
- num: 0
Applications
- Conductance can be used to measure how well connected a graph is, making it an useful auxiliary measure to assess the quality of clusters in a graph, since these could be regarded as the subsets of a cut.
- Parameters:
graph
- the graph.partition
- Partition of the graph with the corresponding node collections.partitionIndex
- number of the component to be used for computing its conductance.- Returns:
- Scalar (double) to store the conductance value of the given cut.
Examples
PgxGraph graph = ...; Partition<Integer> partition = analyst.communitiesConductanceMinimization(graph); PgxFuture<Scalar<Double>> promise = analyst.conductanceAsync(graph, partition, 0); promise.thenAccept(conductance -> { conductance.get(); });
- See Also:
- Graph Conductance.
- Time:
-
conductanceAsync
public <ID> PgxFuture<Scalar<java.lang.Double>> conductanceAsync(PgxGraph graph, Partition<ID> partition, long partitionIndex, Scalar<java.lang.Double> conductance)
Conductance assesses the quality of a partition in a graph
Definition
Conductance in a graph is computed for a specific cut of it. A cut is a partition of the graph into two subsets (components), disconnecting the graph if the edges from the cut are removed. Thus the algorithm requires a labeling for the vertices in the different subsets of the graph, then the conductance is computed by the ratio of the edges belonging to the given cut (i.e. the edges that split the graph into disconnected components) and the edges belonging to each of these subsets. If there is more than one cut (or partition), this implementation will take the given component number as reference to compute the conductance associated with that particular cut.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V) with V = number of vertices
- Space:
O(1)
Default Values
- num: 0
Applications
- Conductance can be used to measure how well connected a graph is, making it an useful auxiliary measure to assess the quality of clusters in a graph, since these could be regarded as the subsets of a cut.
- Parameters:
graph
- the graph.partition
- Partition of the graph with the corresponding node collections.partitionIndex
- number of the component to be used for computing its conductance.conductance
- Scalar (double) to store the conductance value of the given cut.- Returns:
- Scalar (double) to store the conductance value of the given cut.
Examples
PgxGraph graph = ...; Scalar<Double> scalar = graph.createScalar(PropertyType.DOUBLE); Partition<Integer> partition = analyst.communitiesConductanceMinimization(graph); PgxFuture<Scalar<Double>> promise = analyst.conductanceAsync(graph, partition, 0, scalar); promise.thenAccept(conductance -> { conductance.get(); });
- See Also:
- Graph Conductance.
- Time:
-
partitionConductanceAsync
public <ID> PgxFuture<Pair<Scalar<java.lang.Double>,Scalar<java.lang.Double>>> partitionConductanceAsync(PgxGraph graph, Partition<ID> partition)
Partition conductance assesses the quality of many partitions in a graph
Definition
This variant of the conductance algorithm will compute the conductance for the given number of components, returning an output with the minimum value of conductance found from the corresponding partitions and their average conductance value.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization. Note that this algorithm will be inefficient if number_of_components are big (i.e. O(N)).
Complexity
- Time:
O(E) with E = number of edges
- Space:
O(1)
Default Values
Applications
- Conductance can be used to measure how well connected is a graph, making it an useful auxiliary measure to assess the quality of clusters in a graph, since these could be regarded as the subsets of a cut.
- Parameters:
graph
- the graph.partition
- Partition of the graph with the corresponding node collections.- Returns:
- Pair with two scalars, the first one with the value of the average conductance, and the second with
minimun conductance value.
Examples
PgxGraph graph = ...; Partition<Integer> partition = analyst.communitiesConductanceMinimization(graph); PgxFuture<Pair<Scalar<Double>, Scalar<Double>>> promise = analyst.partitionConductanceAsync(graph, partition); promise.thenAccept(coductance -> { coductance.getFirst().get(); coductance.getSecond().get(); });
- Time:
-
partitionConductanceAsync
public <ID> PgxFuture<Pair<Scalar<java.lang.Double>,Scalar<java.lang.Double>>> partitionConductanceAsync(PgxGraph graph, Partition<ID> partition, Scalar<java.lang.Double> avgConductance, Scalar<java.lang.Double> minConductance)
Partition conductance assesses the quality of many partitions in a graph
Definition
This variant of the conductance algorithm will compute the conductance for the given number of components, returning an output with the minimum value of conductance found from the corresponding partitions and their average conductance value.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization. Note that this algorithm will be inefficient if number_of_components are big (i.e. O(N)).
Complexity
- Time:
O(E) with E = number of edges
- Space:
O(1)
Default Values
Applications
- Conductance can be used to measure how well connected is a graph, making it an useful auxiliary measure to assess the quality of clusters in a graph, since these could be regarded as the subsets of a cut.
- Parameters:
graph
- the graph.partition
- Partition of the graph with the corresponding node collections.avgConductance
- Scalar that will get updated with the computed average conductance value.minConductance
- Scalar that will get updated with the computed minimum conductance value.- Returns:
- Pair with two scalars, the first one with the value of the average conductance, and the second with
minimun conductance value.
Examples
PgxGraph graph = ...; Partition<Integer> partition = analyst.communitiesConductanceMinimization(graph); Scalar<Double> avgConductance = graph.createScalar(PropertyType.DOUBLE); Scalar<Double> minConductance = graph.createScalar(PropertyType.DOUBLE); PgxFuture<Pair<Scalar<Double>, Scalar<Double>>> promise = analyst.partitionConductanceAsync( graph, partition, avgConductance, minConductance); promise.thenAccept(coductance -> { coductance.getFirst().get(); coductance.getSecond().get(); });
- Time:
-
partitionModularityAsync
public <ID> PgxFuture<Scalar<java.lang.Double>> partitionModularityAsync(PgxGraph graph, Partition<ID> partition)
Modularity summarizes information about the quality of components in a graph
Definition
Modularity in a graph is a measure for assessing the quality of the partition induced by the components (or community structures) within the graph found by any clustering algorithm (e.g. label propagation, Infomap, WCC, etc.). It compares the number of the edges between the vertices within a component against the expected number of edges if these were generated at random (assuming a uniform probability distribution). A positive modularity value means that, on average, there are more edges within the components than the amount expected (meaning stronger components), and vice-versa for a negative modularity value. This implementation is intended for directed graphs.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization. Note that this algorithm will be inefficient if number_of_components are big (i.e. O(N)).
Complexity
- Time:
O(E * c) with E = number of edges, c = number of components
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Since modularity help to assess the quality of communities in a graph, it can be used in optimization processes when detecting them in other algorithms.
- Parameters:
graph
- the graph.partition
- Partition of the graph with the corresponding node collections.- Returns:
- Scalar (double) with the modularity value.
Examples
PgxGraph graph = ...; Partition<Integer> partition = analyst.communitiesConductanceMinimization(graph); PgxFuture<Scalar<Double>> promise = analyst.partitionModularityAsync(graph, partition); promise.thenAccept(modularity -> { modularity.get(); });
- Time:
-
partitionModularityAsync
public <ID> PgxFuture<Scalar<java.lang.Double>> partitionModularityAsync(PgxGraph graph, Partition<ID> partition, Scalar<java.lang.Double> modularity)
Modularity summarizes information about the quality of components in a graph
Definition
Modularity in a graph is a measure for assessing the quality of the partition induced by the components (or community structures) within the graph found by any clustering algorithm (e.g. label propagation, Infomap, WCC, etc.). It compares the number of the edges between the vertices within a component against the expected number of edges if these were generated at random (assuming a uniform probability distribution). A positive modularity value means that, on average, there are more edges within the components than the amount expected (meaning stronger components), and vice-versa for a negative modularity value. This implementation is intended for directed graphs.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization. Note that this algorithm will be inefficient if number_of_components are big (i.e. O(N)).
Complexity
- Time:
O(E * c) with E = number of edges, c = number of components
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Since modularity help to assess the quality of communities in a graph, it can be used in optimization processes when detecting them in other algorithms.
- Parameters:
graph
- the graph.partition
- Partition of the graph with the corresponding node collections.modularity
- Scalar (double) to store the modularity value.- Returns:
- Scalar (double) with the modularity value.
Examples
PgxGraph graph = ...; Partition<Integer> partition = analyst.communitiesConductanceMinimization(graph); Scalar<Double> scalar = graph.createScalar(PropertyType.DOUBLE); PgxFuture<Scalar<Double>> promise = analyst.partitionModularityAsync(graph, partition, scalar); promise.thenAccept(modularity -> { modularity.get(); });
- Time:
-
partitionModularityAsync
public <ID> PgxFuture<Scalar<java.lang.Double>> partitionModularityAsync(PgxGraph graph, Partition<ID> partition, java.lang.String modularityName)
-
sccKosarajuAsync
public <ID> PgxFuture<Partition<ID>> sccKosarajuAsync(PgxGraph graph)
Kosaraju finds strongly connected components in a graph
Definition
Kosaraju's algorithm works on directed graphs for finding strongly connected components (SCC). A SCC is a maximal subset of vertices of the graph with the particular characteristic that every vertex in the SCC can be reachable from any other other vertex in the SCC.
Implementation Details
The implementation of this algorithm uses the built-in DFS and BFS features.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- It can be used for clustering and, in social networks, to spot out groups of people (communities), since people in groups tend to have a high density of links between them.
- Parameters:
graph
- the graph.- Returns:
- Partition holding the node collections corresponding to the components found by the algorithm.
Examples
PgxGraph graph = ...; PgxFuture<Partition<Integer>> promise = analyst.sccKosarajuAsync(graph); promise.thenCompose(scc -> graph.queryPgqlAsync( "SELECT x, x." + scc.getPropertyName() + " MATCH (x) ORDER BY x." + scc.getPropertyName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
sccKosarajuAsync
public <ID> PgxFuture<Partition<ID>> sccKosarajuAsync(PgxGraph graph, VertexProperty<ID,java.lang.Long> partitionDistribution)
Kosaraju finds strongly connected components in a graph
Definition
Kosaraju's algorithm works on directed graphs for finding strongly connected components (SCC). A SCC is a maximal subset of vertices of the graph with the particular characteristic that every vertex in the SCC can be reachable from any other other vertex in the SCC.
Implementation Details
The implementation of this algorithm uses the built-in DFS and BFS features.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- It can be used for clustering and, in social networks, to spot out groups of people (communities), since people in groups tend to have a high density of links between them.
- Parameters:
graph
- the graph.partitionDistribution
- vertex property holding the label of the SCC assigned to each vertex.- Returns:
- Partition holding the node collections corresponding to the components found by the algorithm.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Long> pd = graph.createVertexProperty(PropertyType.LONG); PgxFuture<Partition<Integer>> promise = analyst.sccKosarajuAsync(graph, pd); promise.thenCompose(scc -> graph.queryPgqlAsync( "SELECT x, x." + scc.getPropertyName() + " MATCH (x) ORDER BY x." + scc.getPropertyName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
sccTarjanAsync
public <ID> PgxFuture<Partition<ID>> sccTarjanAsync(PgxGraph graph)
Tarjan finds strongly connected components in a graph
Definition
Tarjan's algorithm works on directed graphs for finding strongly connected components (SCC). A SCC is a maximal subset of vertices of the graph with the particular characteristic that every vertex in the SCC can be reachable from any other other vertex in the SCC.
Implementation Details
The implementation of this algorithm uses the built-in DFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(5 * V) with V = number of vertices
Default Values
Applications
- It can be used for clustering and, in social networks, to spot out groups of people (communities), since people in groups tend to have a high density of links between them.
- Parameters:
graph
- the graph.- Returns:
- Partition holding the node collections corresponding to the components found by the algorithm.
Examples
PgxGraph graph = ...; PgxFuture<Partition<Integer>> promise = analyst.sccTarjanAsync(graph); promise.thenCompose(scc -> graph.queryPgqlAsync( "SELECT x, x." + scc.getPropertyName() + " MATCH (x) ORDER BY x." + scc.getPropertyName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
sccTarjanAsync
public <ID> PgxFuture<Partition<ID>> sccTarjanAsync(PgxGraph graph, VertexProperty<ID,java.lang.Long> partitonDistribution)
Tarjan finds strongly connected components in a graph
Definition
Tarjan's algorithm works on directed graphs for finding strongly connected components (SCC). A SCC is a maximal subset of vertices of the graph with the particular characteristic that every vertex in the SCC can be reachable from any other other vertex in the SCC.
Implementation Details
The implementation of this algorithm uses the built-in DFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(5 * V) with V = number of vertices
Default Values
Applications
- It can be used for clustering and, in social networks, to spot out groups of people (communities), since people in groups tend to have a high density of links between them.
- Parameters:
graph
- the graph.partitonDistribution
- vertex property holding the label of the SCC assigned to each vertex.- Returns:
- Partition holding the node collections corresponding to the components found by the algorithm.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Long> pd = graph.createVertexProperty(PropertyType.LONG); PgxFuture<Partition<Integer>> promise = analyst.sccTarjanAsync(graph, pd); promise.thenCompose(scc -> graph.queryPgqlAsync( "SELECT x, x." + scc.getPropertyName() + " MATCH (x) ORDER BY x." + scc.getPropertyName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
wccAsync
public <ID> PgxFuture<Partition<ID>> wccAsync(PgxGraph graph)
Identifying weakly connected components can be useful for clustering graph data
Definition
This algorithm finds weakly connected components (WCC) in a directed graph. A WCC is a maximal subset of vertices of the graph with the particular characteristic that for every pair of vertices U and V in the WCC there must be a path connecting U to V, ignoring the direction of edges. It is a non-deterministic algorithm because of its parallelized implementation.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(E * d) with d = diameter of the graph
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It can be used for clustering and analysis in social networks.
- Parameters:
graph
- the graph.- Returns:
- Partition holding the node collections corresponding to the components found by the algorithm.
Examples
PgxGraph graph = ...; PgxFuture<Partition<Integer>> promise = analyst.wccAsync(graph); promise.thenCompose(wcc -> graph.queryPgqlAsync( "SELECT x, x." + wcc.getPropertyName() + " MATCH (x) ORDER BY x." + wcc.getPropertyName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- Connectivity "("graph theory")"
- Time:
-
wccAsync
public <ID> PgxFuture<Partition<ID>> wccAsync(PgxGraph graph, VertexProperty<ID,java.lang.Long> partitionDistribution)
Identifying weakly connected components can be useful for clustering graph data
Definition
This algorithm finds weakly connected components (WCC) in a directed graph. A WCC is a maximal subset of vertices of the graph with the particular characteristic that for every pair of vertices U and V in the WCC there must be a path connecting U to V, ignoring the direction of edges. It is a non-deterministic algorithm because of its parallelized implementation.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(E * d) with d = diameter of the graph
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It can be used for clustering and analysis in social networks.
- Parameters:
graph
- the graph.partitionDistribution
- vertex property holding the label of the WCC assigned to each vertex.- Returns:
- Partition holding the node collections corresponding to the components found by the algorithm.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Long> pd = graph.createVertexProperty(PropertyType.LONG); PgxFuture<Partition<Integer>> promise = analyst.wccAsync(graph, pd); promise.thenCompose(wcc -> graph.queryPgqlAsync( "SELECT x, x." + wcc.getPropertyName() + " MATCH (x) ORDER BY x." + wcc.getPropertyName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- Connectivity "("graph theory")"
- Time:
-
wccAsync
public <ID> PgxFuture<Partition<ID>> wccAsync(PgxGraph graph, java.lang.String partitonDistributionName)
-
salsaAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> salsaAsync(BipartiteGraph graph)
SALSA computes ranking scores. It assesses the quality of information and references in linked structures
Definition
The idea of hubs and authorities comes from the web pages: a hub is regarded as a page that is not authoritative in a specific matter, but it has instead links to authority pages, which are regarded as meaningful sources for a particular topic by many hubs. Thus a good hub will point to many authorities, while a good authority will be pointed by many hubs. SALSA is an algorithm that computes authorities and hubs ranking scores for the vertices using the network created by the edges of the [bipartite](prog-guides/mutation-subgraph/subgraph.html#create-a-bipartite-subgraph-based-on-a-vertex-list) graph and assigning weights to the contributions of their 2nd-degree neighbors. This way of computing the scores creates the independence between the authority and hub scores, which are assigned to the vertices depending on the side of the graph they belong (left:hub / right:aut).
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- SALSA was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- Bipartite graph.- Returns:
- vertex property holding the normalized authority/hub ranking score for each vertex.
Examples
PgxGraph graph = ...; PgxFuture<VertexProperty<Integer, Double>> promise = analyst.salsaAsync(graph); promise.thenCompose(salsa -> graph.queryPgqlAsync( "SELECT x, x." + salsa.getName() + " MATCH (x) ORDER BY x." + salsa.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
salsaAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> salsaAsync(BipartiteGraph graph, double maxDiff, int maxIter)
SALSA computes ranking scores. It assesses the quality of information and references in linked structures
Definition
The idea of hubs and authorities comes from the web pages: a hub is regarded as a page that is not authoritative in a specific matter, but it has instead links to authority pages, which are regarded as meaningful sources for a particular topic by many hubs. Thus a good hub will point to many authorities, while a good authority will be pointed by many hubs. SALSA is an algorithm that computes authorities and hubs ranking scores for the vertices using the network created by the edges of the [bipartite](prog-guides/mutation-subgraph/subgraph.html#create-a-bipartite-subgraph-based-on-a-vertex-list) graph and assigning weights to the contributions of their 2nd-degree neighbors. This way of computing the scores creates the independence between the authority and hub scores, which are assigned to the vertices depending on the side of the graph they belong (left:hub / right:aut).
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- SALSA was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- Bipartite graph.maxDiff
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.maxIter
- maximum number of iterations that will be performed.- Returns:
- vertex property holding the normalized authority/hub ranking score for each vertex.
Examples
PgxGraph graph = ...; PgxFuture<VertexProperty<Integer, Double>> promise = analyst.salsaAsync(graph, 0.001, 100); promise.thenCompose(salsa -> graph.queryPgqlAsync( "SELECT x, x." + salsa.getName() + " MATCH (x) ORDER BY x." + salsa.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
salsaAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> salsaAsync(BipartiteGraph graph, VertexProperty<ID,java.lang.Double> salsaRank)
SALSA computes ranking scores. It assesses the quality of information and references in linked structures
Definition
The idea of hubs and authorities comes from the web pages: a hub is regarded as a page that is not authoritative in a specific matter, but it has instead links to authority pages, which are regarded as meaningful sources for a particular topic by many hubs. Thus a good hub will point to many authorities, while a good authority will be pointed by many hubs. SALSA is an algorithm that computes authorities and hubs ranking scores for the vertices using the network created by the edges of the [bipartite](prog-guides/mutation-subgraph/subgraph.html#create-a-bipartite-subgraph-based-on-a-vertex-list) graph and assigning weights to the contributions of their 2nd-degree neighbors. This way of computing the scores creates the independence between the authority and hub scores, which are assigned to the vertices depending on the side of the graph they belong (left:hub / right:aut).
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- SALSA was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- Bipartite graph.salsaRank
- (out argument) vertex property holding the normalized authority/hub ranking score for each vertex.- Returns:
- vertex property holding the normalized authority/hub ranking score for each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> rank = graph.createVertexProperty(Property.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.salsaAsync(graph, rank); promise.thenCompose(salsa -> graph.queryPgqlAsync( "SELECT x, x." + salsa.getName() + " MATCH (x) ORDER BY x." + salsa.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
salsaAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> salsaAsync(BipartiteGraph graph, double maxDiff, int maxIter, VertexProperty<ID,java.lang.Double> salsaRank)
SALSA computes ranking scores. It assesses the quality of information and references in linked structures
Definition
The idea of hubs and authorities comes from the web pages: a hub is regarded as a page that is not authoritative in a specific matter, but it has instead links to authority pages, which are regarded as meaningful sources for a particular topic by many hubs. Thus a good hub will point to many authorities, while a good authority will be pointed by many hubs. SALSA is an algorithm that computes authorities and hubs ranking scores for the vertices using the network created by the edges of the [bipartite](prog-guides/mutation-subgraph/subgraph.html#create-a-bipartite-subgraph-based-on-a-vertex-list) graph and assigning weights to the contributions of their 2nd-degree neighbors. This way of computing the scores creates the independence between the authority and hub scores, which are assigned to the vertices depending on the side of the graph they belong (left:hub / right:aut).
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- SALSA was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- Bipartite graph.maxDiff
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.maxIter
- maximum number of iterations that will be performed.salsaRank
- (out argument) vertex property holding the normalized authority/hub ranking score for each vertex.- Returns:
- vertex property holding the normalized authority/hub ranking score for each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> rank = graph.createVertexProperty(Property.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.salsaAsync(graph, 0.001, 100, rank); promise.thenCompose(salsa -> graph.queryPgqlAsync( "SELECT x, x." + salsa.getName() + " MATCH (x) ORDER BY x." + salsa.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
personalizedSalsaAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedSalsaAsync(BipartiteGraph graph, PgxVertex<ID> v)
Personalized salsa for a vertex of interest. It assesses the quality of information and references in linked structures
Definition
This Personalized version of SALSA allows to select a particular vertex or set of vertices from the given graph in order to give them a greater importance when computing the ranking scores, which will have as result a personalized SALSA score and show relevant (or similar) vertices to the ones chosen for the personalization.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- SALSA was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- Bipartite graph.v
- the chosen vertex from the graph for personalization.- Returns:
- vertex property holding the normalized authority/hub ranking score for each vertex.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedSalsaAsync(graph, vertex); promise.thenCompose(salsa -> graph.queryPgqlAsync( "SELECT x, x." + salsa.getName() + " MATCH (x) ORDER BY x." + salsa.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
personalizedSalsaAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedSalsaAsync(BipartiteGraph graph, PgxVertex<ID> v, double d, int maxIter, double maxDiff)
Personalized salsa for a vertex of interest. It assesses the quality of information and references in linked structures
Definition
This Personalized version of SALSA allows to select a particular vertex or set of vertices from the given graph in order to give them a greater importance when computing the ranking scores, which will have as result a personalized SALSA score and show relevant (or similar) vertices to the ones chosen for the personalization.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- SALSA was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- Bipartite graph.v
- the chosen vertex from the graph for personalization.d
- damping factor to modulate the degree of personalization of the scores by the algorithm.maxIter
- maximum number of iterations that will be performed.maxDiff
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.- Returns:
- vertex property holding the normalized authority/hub ranking score for each vertex.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedSalsaAsync( graph, vertex, 0.85, 100, 0.001); promise.thenCompose(salsa -> graph.queryPgqlAsync( "SELECT x, x." + salsa.getName() + " MATCH (x) ORDER BY x." + salsa.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
personalizedSalsaAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedSalsaAsync(BipartiteGraph graph, PgxVertex<ID> v, VertexProperty<ID,java.lang.Double> salsaRank)
Personalized salsa for a vertex of interest. It assesses the quality of information and references in linked structures
Definition
This Personalized version of SALSA allows to select a particular vertex or set of vertices from the given graph in order to give them a greater importance when computing the ranking scores, which will have as result a personalized SALSA score and show relevant (or similar) vertices to the ones chosen for the personalization.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- SALSA was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- Bipartite graph.v
- the chosen vertex from the graph for personalization.salsaRank
- (out argument) vertex property holding the normalized authority/hub ranking score for each vertex.- Returns:
- vertex property holding the normalized authority/hub ranking score for each vertex.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedSalsaAsync(graph, vertex, rank); promise.thenCompose(salsa -> graph.queryPgqlAsync( "SELECT x, x." + salsa.getName() + " MATCH (x) ORDER BY x." + salsa.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
personalizedSalsaAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedSalsaAsync(BipartiteGraph graph, PgxVertex<ID> v, double d, int maxIter, double maxDiff, VertexProperty<ID,java.lang.Double> salsaRank)
Personalized salsa for a vertex of interest. It assesses the quality of information and references in linked structures
Definition
This Personalized version of SALSA allows to select a particular vertex or set of vertices from the given graph in order to give them a greater importance when computing the ranking scores, which will have as result a personalized SALSA score and show relevant (or similar) vertices to the ones chosen for the personalization.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- SALSA was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- Bipartite graph.v
- the chosen vertex from the graph for personalization.d
- damping factor to modulate the degree of personalization of the scores by the algorithm.maxIter
- maximum number of iterations that will be performed.maxDiff
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.salsaRank
- (out argument) vertex property holding the normalized authority/hub ranking score for each vertex.- Returns:
- vertex property holding the normalized authority/hub ranking score for each vertex.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedSalsaAsync( graph, vertex, 0.85, 100, 0.001, rank); promise.thenCompose(salsa -> graph.queryPgqlAsync( "SELECT x, x." + salsa.getName() + " MATCH (x) ORDER BY x." + salsa.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
personalizedSalsaAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedSalsaAsync(BipartiteGraph graph, VertexSet<ID> vertices)
Personalized salsa for a set of vertices of interest. It assesses the quality of information and references in linked structures
Definition
This Personalized version of SALSA allows to select a particular vertex or set of vertices from the given graph in order to give them a greater importance when computing the ranking scores, which will have as result a personalized SALSA score and show relevant (or similar) vertices to the ones chosen for the personalization.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- SALSA was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- Bipartite graph.vertices
- the set of chosen vertices from the graph for personalization.- Returns:
- vertex property holding the normalized authority/hub ranking score for each vertex.
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedSalsaAsync(graph, vertices); promise.thenCompose(salsa -> graph.queryPgqlAsync( "SELECT x, x." + salsa.getName() + " MATCH (x) ORDER BY x." + salsa.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
personalizedSalsaAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedSalsaAsync(BipartiteGraph graph, VertexSet<ID> vertices, double d, int maxIter, double maxDiff)
Personalized salsa for a set of vertices of interest. It assesses the quality of information and references in linked structures
Definition
This Personalized version of SALSA allows to select a particular vertex or set of vertices from the given graph in order to give them a greater importance when computing the ranking scores, which will have as result a personalized SALSA score and show relevant (or similar) vertices to the ones chosen for the personalization.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- SALSA was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- Bipartite graph.vertices
- the set of chosen vertices from the graph for personalization.d
- damping factor to modulate the degree of personalization of the scores by the algorithm.maxIter
- maximum number of iterations that will be performed.maxDiff
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.- Returns:
- vertex property holding the normalized authority/hub ranking score for each vertex.
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedSalsaAsync( graph, vertices, 0.85, 100, 0.001); promise.thenCompose(salsa -> graph.queryPgqlAsync( "SELECT x, x." + salsa.getName() + " MATCH (x) ORDER BY x." + salsa.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
personalizedSalsaAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedSalsaAsync(BipartiteGraph graph, VertexSet<ID> vertices, double d, int maxIter, double maxDiff, VertexProperty<ID,java.lang.Double> salsaRank)
Personalized salsa for a set of vertices of interest. It assesses the quality of information and references in linked structures
Definition
This Personalized version of SALSA allows to select a particular vertex or set of vertices from the given graph in order to give them a greater importance when computing the ranking scores, which will have as result a personalized SALSA score and show relevant (or similar) vertices to the ones chosen for the personalization.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- SALSA was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- Bipartite graph.vertices
- the set of chosen vertices from the graph for personalization.d
- damping factor to modulate the degree of personalization of the scores by the algorithm.maxIter
- maximum number of iterations that will be performed.maxDiff
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.salsaRank
- (out argument) vertex property holding the normalized authority/hub ranking score for each vertex.- Returns:
- vertex property holding the normalized authority/hub ranking score for each vertex.
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedSalsaAsync( graph, vertices, 0.85, 100, 0.001, rank); promise.thenCompose(salsa -> graph.queryPgqlAsync( "SELECT x, x." + salsa.getName() + " MATCH (x) ORDER BY x." + salsa.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
personalizedSalsaAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> personalizedSalsaAsync(BipartiteGraph graph, VertexSet<ID> vertices, VertexProperty<ID,java.lang.Double> salsaRank)
Personalized salsa for a set of vertices of interest. It assesses the quality of information and references in linked structures
Definition
This Personalized version of SALSA allows to select a particular vertex or set of vertices from the given graph in order to give them a greater importance when computing the ranking scores, which will have as result a personalized SALSA score and show relevant (or similar) vertices to the ones chosen for the personalization.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- SALSA was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- Bipartite graph.vertices
- the set of chosen vertices from the graph for personalization.salsaRank
- (out argument) vertex property holding the normalized authority/hub ranking score for each vertex.- Returns:
- vertex property holding the normalized authority/hub ranking score for each vertex.
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.personalizedSalsaAsync(graph, vertices, rank); promise.thenCompose(salsa -> graph.queryPgqlAsync( "SELECT x, x." + salsa.getName() + " MATCH (x) ORDER BY x." + salsa.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
whomToFollowAsync
public <ID> PgxFuture<Pair<VertexSequence<ID>,VertexSequence<ID>>> whomToFollowAsync(PgxGraph graph, PgxVertex<ID> vertex)
WTF is a recommendation algorithm. It returns two vertex sequences: one of similar users and a second one with users to follow.
Definition
The Whom To Follow algorithm is composed by two main stages: the first one is meant to get the relevant vertices (users) for a given source vertex (particular user), which in this implementation is done with personalized Pagerank for the given source vertex. While the second stage analyzes the relationships between the relevant vertices previously found through the edges linking them with their neighbors. This second stage relies on SALSA algorithm and it assigns a ranking score to all the hubs and authority vertices, so the recommendations can come from this assigned values. Whom To Follow takes the concept of authority and hub vertices, and adapts it to users in social networks. The hub vertices become similar users with respect to the given source vertex (also an user), and the authority vertices are translated into users that might be on the interest of the source vertex, i.e. users to follow.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * (p + s)) with E = number of edges, p <= maximum number of iterations for the Pagerank step, s <= maximum number of iterations for the SALSA step
- Space:
O(5 * V) with V = number of vertices
Default Values
Applications
- WTF was designed to find and recommend similar users (hub vertices) and potential users to follow (authority vertices) in social networks with directed edges in their structures.
- Parameters:
graph
- the graph.vertex
- the chosen vertex from the graph for personalization of the recommendations.- Returns:
- Pair holding the node sequences with the hub and authority recommendations.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); PgxFuture<Pair<VertexSequence<Integer>, VertexSequence<Integer>>> promise = analyst.whomToFollowAsync( graph, vertex); promise.thenAccept(wtf -> { wtf.getFirst(); wtf.getSecond(); });
- Time:
-
whomToFollowAsync
public <ID> PgxFuture<Pair<VertexSequence<ID>,VertexSequence<ID>>> whomToFollowAsync(PgxGraph graph, PgxVertex<ID> vertex, int topK)
WTF is a recommendation algorithm. It returns two vertex sequences: one of similar users and a second one with users to follow.
Definition
The Whom To Follow algorithm is composed by two main stages: the first one is meant to get the relevant vertices (users) for a given source vertex (particular user), which in this implementation is done with personalized Pagerank for the given source vertex. While the second stage analyzes the relationships between the relevant vertices previously found through the edges linking them with their neighbors. This second stage relies on SALSA algorithm and it assigns a ranking score to all the hubs and authority vertices, so the recommendations can come from this assigned values. Whom To Follow takes the concept of authority and hub vertices, and adapts it to users in social networks. The hub vertices become similar users with respect to the given source vertex (also an user), and the authority vertices are translated into users that might be on the interest of the source vertex, i.e. users to follow.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * (p + s)) with E = number of edges, p <= maximum number of iterations for the Pagerank step, s <= maximum number of iterations for the SALSA step
- Space:
O(5 * V) with V = number of vertices
Default Values
Applications
- WTF was designed to find and recommend similar users (hub vertices) and potential users to follow (authority vertices) in social networks with directed edges in their structures.
- Parameters:
graph
- the graph.vertex
- the chosen vertex from the graph for personalization of the recommendations.topK
- the maximum number of recommendations that will be returned. This number should be smaller than the size of the circle of trust.- Returns:
- Pair holding the node sequences with the hub and authority recommendations.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); PgxFuture<Pair<VertexSequence<Integer>, VertexSequence<Integer>>> promise = analyst.whomToFollowAsync( graph, vertex, 100); promise.thenAccept(wtf -> { wtf.getFirst(); wtf.getSecond(); });
- Time:
-
whomToFollowAsync
public <ID> PgxFuture<Pair<VertexSequence<ID>,VertexSequence<ID>>> whomToFollowAsync(PgxGraph graph, PgxVertex<ID> vertex, int topK, int sizeCircleOfTrust)
WTF is a recommendation algorithm. It returns two vertex sequences: one of similar users and a second one with users to follow.
Definition
The Whom To Follow algorithm is composed by two main stages: the first one is meant to get the relevant vertices (users) for a given source vertex (particular user), which in this implementation is done with personalized Pagerank for the given source vertex. While the second stage analyzes the relationships between the relevant vertices previously found through the edges linking them with their neighbors. This second stage relies on SALSA algorithm and it assigns a ranking score to all the hubs and authority vertices, so the recommendations can come from this assigned values. Whom To Follow takes the concept of authority and hub vertices, and adapts it to users in social networks. The hub vertices become similar users with respect to the given source vertex (also an user), and the authority vertices are translated into users that might be on the interest of the source vertex, i.e. users to follow.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * (p + s)) with E = number of edges, p <= maximum number of iterations for the Pagerank step, s <= maximum number of iterations for the SALSA step
- Space:
O(5 * V) with V = number of vertices
Default Values
Applications
- WTF was designed to find and recommend similar users (hub vertices) and potential users to follow (authority vertices) in social networks with directed edges in their structures.
- Parameters:
graph
- the graph.vertex
- the chosen vertex from the graph for personalization of the recommendations.topK
- the maximum number of recommendations that will be returned. This number should be smaller than the size of the circle of trust.sizeCircleOfTrust
- the maximum size of the circle of trust.- Returns:
- Pair holding the node sequences with the hub and authority recommendations.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); PgxFuture<Pair<VertexSequence<Integer>, VertexSequence<Integer>>> promise = analyst.whomToFollowAsync( graph, vertex, 100, 500); promise.thenAccept(wtf -> { wtf.getFirst(); wtf.getSecond(); });
- Time:
-
whomToFollowAsync
public <ID> PgxFuture<Pair<VertexSequence<ID>,VertexSequence<ID>>> whomToFollowAsync(PgxGraph graph, PgxVertex<ID> vertex, VertexSequence<ID> hubs, VertexSequence<ID> authorities)
WTF is a recommendation algorithm. It returns two vertex sequences: one of similar users and a second one with users to follow.
Definition
The Whom To Follow algorithm is composed by two main stages: the first one is meant to get the relevant vertices (users) for a given source vertex (particular user), which in this implementation is done with personalized Pagerank for the given source vertex. While the second stage analyzes the relationships between the relevant vertices previously found through the edges linking them with their neighbors. This second stage relies on SALSA algorithm and it assigns a ranking score to all the hubs and authority vertices, so the recommendations can come from this assigned values. Whom To Follow takes the concept of authority and hub vertices, and adapts it to users in social networks. The hub vertices become similar users with respect to the given source vertex (also an user), and the authority vertices are translated into users that might be on the interest of the source vertex, i.e. users to follow.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * (p + s)) with E = number of edges, p <= maximum number of iterations for the Pagerank step, s <= maximum number of iterations for the SALSA step
- Space:
O(5 * V) with V = number of vertices
Default Values
Applications
- WTF was designed to find and recommend similar users (hub vertices) and potential users to follow (authority vertices) in social networks with directed edges in their structures.
- Parameters:
graph
- the graph.vertex
- the chosen vertex from the graph for personalization of the recommendations.hubs
- (out argument) vertex sequence holding the top rated hub vertices (similar users) for the recommendations.authorities
- (out argument) vertex sequence holding the top rated authority vertices (users to follow) for the recommendations.- Returns:
- Pair holding the node sequences with the hub and authority recommendations.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexSequence<Integer> hubs = graph.createVertexSequence(); VertexSequence<Integer> authorities = graph.createVertexSequence(); PgxFuture<Pair<VertexSequence<Integer>, VertexSequence<Integer>>> promise = analyst.whomToFollowAsync( graph, vertex, hubs, authorities); promise.thenAccept(wtf -> { wtf.getFirst(); wtf.getSecond(); });
- Time:
-
whomToFollowAsync
public <ID> PgxFuture<Pair<VertexSequence<ID>,VertexSequence<ID>>> whomToFollowAsync(PgxGraph graph, PgxVertex<ID> vertex, int topK, VertexSequence<ID> hubs, VertexSequence<ID> authorities)
WTF is a recommendation algorithm. It returns two vertex sequences: one of similar users and a second one with users to follow.
Definition
The Whom To Follow algorithm is composed by two main stages: the first one is meant to get the relevant vertices (users) for a given source vertex (particular user), which in this implementation is done with personalized Pagerank for the given source vertex. While the second stage analyzes the relationships between the relevant vertices previously found through the edges linking them with their neighbors. This second stage relies on SALSA algorithm and it assigns a ranking score to all the hubs and authority vertices, so the recommendations can come from this assigned values. Whom To Follow takes the concept of authority and hub vertices, and adapts it to users in social networks. The hub vertices become similar users with respect to the given source vertex (also an user), and the authority vertices are translated into users that might be on the interest of the source vertex, i.e. users to follow.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * (p + s)) with E = number of edges, p <= maximum number of iterations for the Pagerank step, s <= maximum number of iterations for the SALSA step
- Space:
O(5 * V) with V = number of vertices
Default Values
Applications
- WTF was designed to find and recommend similar users (hub vertices) and potential users to follow (authority vertices) in social networks with directed edges in their structures.
- Parameters:
graph
- the graph.vertex
- the chosen vertex from the graph for personalization of the recommendations.topK
- the maximum number of recommendations that will be returned. This number should be smaller than the size of the circle of trust.hubs
- (out argument) vertex sequence holding the top rated hub vertices (similar users) for the recommendations.authorities
- (out argument) vertex sequence holding the top rated authority vertices (users to follow) for the recommendations.- Returns:
- Pair holding the node sequences with the hub and authority recommendations.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexSequence<Integer> hubs = graph.createVertexSequence(); VertexSequence<Integer> authorities = graph.createVertexSequence(); PgxFuture<Pair<VertexSequence<Integer>, VertexSequence<Integer>>> promise = analyst.whomToFollowAsync( graph, vertex, 100, hubs, authorities); promise.thenAccept(wtf -> { wtf.getFirst(); wtf.getSecond(); });
- Time:
-
whomToFollowAsync
public <ID> PgxFuture<Pair<VertexSequence<ID>,VertexSequence<ID>>> whomToFollowAsync(PgxGraph graph, PgxVertex<ID> vertex, int topK, int sizeCircleOfTrust, VertexSequence<ID> hubs, VertexSequence<ID> authorities)
WTF is a recommendation algorithm. It returns two vertex sequences: one of similar users and a second one with users to follow.
Definition
The Whom To Follow algorithm is composed by two main stages: the first one is meant to get the relevant vertices (users) for a given source vertex (particular user), which in this implementation is done with personalized Pagerank for the given source vertex. While the second stage analyzes the relationships between the relevant vertices previously found through the edges linking them with their neighbors. This second stage relies on SALSA algorithm and it assigns a ranking score to all the hubs and authority vertices, so the recommendations can come from this assigned values. Whom To Follow takes the concept of authority and hub vertices, and adapts it to users in social networks. The hub vertices become similar users with respect to the given source vertex (also an user), and the authority vertices are translated into users that might be on the interest of the source vertex, i.e. users to follow.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * (p + s)) with E = number of edges, p <= maximum number of iterations for the Pagerank step, s <= maximum number of iterations for the SALSA step
- Space:
O(5 * V) with V = number of vertices
Default Values
Applications
- WTF was designed to find and recommend similar users (hub vertices) and potential users to follow (authority vertices) in social networks with directed edges in their structures.
- Parameters:
graph
- the graph.vertex
- the chosen vertex from the graph for personalization of the recommendations.topK
- the maximum number of recommendations that will be returned. This number should be smaller than the size of the circle of trust.sizeCircleOfTrust
- the maximum size of the circle of trust.hubs
- (out argument) vertex sequence holding the top rated hub vertices (similar users) for the recommendations.authorities
- (out argument) vertex sequence holding the top rated authority vertices (users to follow) for the recommendations.- Returns:
- Pair holding the node sequences with the hub and authority recommendations.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexSequence<Integer> hubs = graph.createVertexSequence(); VertexSequence<Integer> authorities = graph.createVertexSequence(); PgxFuture<Pair<VertexSequence<Integer>, VertexSequence<Integer>>> promise = analyst.whomToFollowAsync( graph, vertex, 100, 500, hubs, authorities); promise.thenAccept(wtf -> { wtf.getFirst(); wtf.getSecond(); });
- Time:
-
whomToFollowAsync
public <ID> PgxFuture<Pair<VertexSequence<ID>,VertexSequence<ID>>> whomToFollowAsync(PgxGraph graph, PgxVertex<ID> vertex, int topK, int sizeCircleOfTrust, int maxIter, double tol, double dampingFactor, int salsaMaxIter, double salsaTol)
WTF is a recommendation algorithm. It returns two vertex sequences: one of similar users and a second one with users to follow.
Definition
The Whom To Follow algorithm is composed by two main stages: the first one is meant to get the relevant vertices (users) for a given source vertex (particular user), which in this implementation is done with personalized Pagerank for the given source vertex. While the second stage analyzes the relationships between the relevant vertices previously found through the edges linking them with their neighbors. This second stage relies on SALSA algorithm and it assigns a ranking score to all the hubs and authority vertices, so the recommendations can come from this assigned values. Whom To Follow takes the concept of authority and hub vertices, and adapts it to users in social networks. The hub vertices become similar users with respect to the given source vertex (also an user), and the authority vertices are translated into users that might be on the interest of the source vertex, i.e. users to follow.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * (p + s)) with E = number of edges, p <= maximum number of iterations for the Pagerank step, s <= maximum number of iterations for the SALSA step
- Space:
O(5 * V) with V = number of vertices
Default Values
Applications
- WTF was designed to find and recommend similar users (hub vertices) and potential users to follow (authority vertices) in social networks with directed edges in their structures.
- Parameters:
graph
- the graph.vertex
- the chosen vertex from the graph for personalization of the recommendations.topK
- the maximum number of recommendations that will be returned. This number should be smaller than the size of the circle of trust.sizeCircleOfTrust
- the maximum size of the circle of trust.maxIter
- maximum number of iterations that will be performed for the Pagerank stage.tol
- maximum tolerated error value for the Pagerank stage. The stage will stop once the sum of the error values of all vertices becomes smaller than this value.dampingFactor
- damping factor for the Pagerank stage.salsaMaxIter
- maximum number of iterations that will be performed for the SALSA stage.salsaTol
- maximum tolerated error value for the SALSA stage. The stage will stop once the sum of the error values of all vertices becomes smaller than this value.- Returns:
- Pair holding the node sequences with the hub and authority recommendations.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); PgxFuture<Pair<VertexSequence<Integer>, VertexSequence<Integer>>> promise = analyst.whomToFollowAsync( graph, vertex, 100, 500, 100, 0.001, 0.85, 100, 0.001); promise.thenAccept(wtf -> { wtf.getFirst(); wtf.getSecond(); });
- Time:
-
whomToFollowAsync
public <ID> PgxFuture<Pair<VertexSequence<ID>,VertexSequence<ID>>> whomToFollowAsync(PgxGraph graph, PgxVertex<ID> vertex, int topK, int sizeCircleOfTrust, int maxIter, double tol, double dampingFactor, int salsaMaxIter, double salsaTol, VertexSequence<ID> hubs, VertexSequence<ID> authorities)
WTF is a recommendation algorithm. It returns two vertex sequences: one of similar users and a second one with users to follow.
Definition
The Whom To Follow algorithm is composed by two main stages: the first one is meant to get the relevant vertices (users) for a given source vertex (particular user), which in this implementation is done with personalized Pagerank for the given source vertex. While the second stage analyzes the relationships between the relevant vertices previously found through the edges linking them with their neighbors. This second stage relies on SALSA algorithm and it assigns a ranking score to all the hubs and authority vertices, so the recommendations can come from this assigned values. Whom To Follow takes the concept of authority and hub vertices, and adapts it to users in social networks. The hub vertices become similar users with respect to the given source vertex (also an user), and the authority vertices are translated into users that might be on the interest of the source vertex, i.e. users to follow.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * (p + s)) with E = number of edges, p <= maximum number of iterations for the Pagerank step, s <= maximum number of iterations for the SALSA step
- Space:
O(5 * V) with V = number of vertices
Default Values
Applications
- WTF was designed to find and recommend similar users (hub vertices) and potential users to follow (authority vertices) in social networks with directed edges in their structures.
- Parameters:
graph
- the graph.vertex
- the chosen vertex from the graph for personalization of the recommendations.topK
- the maximum number of recommendations that will be returned. This number should be smaller than the size of the circle of trust.sizeCircleOfTrust
- the maximum size of the circle of trust.maxIter
- maximum number of iterations that will be performed for the Pagerank stage.tol
- maximum tolerated error value for the Pagerank stage. The stage will stop once the sum of the error values of all vertices becomes smaller than this value.dampingFactor
- damping factor for the Pagerank stage.salsaMaxIter
- maximum number of iterations that will be performed for the SALSA stage.salsaTol
- maximum tolerated error value for the SALSA stage. The stage will stop once the sum of the error values of all vertices becomes smaller than this value.hubs
- (out argument) vertex sequence holding the top rated hub vertices (similar users) for the recommendations.authorities
- (out argument) vertex sequence holding the top rated authority vertices (users to follow) for the recommendations.- Returns:
- Pair holding the node sequences with the hub and authority recommendations.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexSequence<Integer> hubs = graph.createVertexSequence(); VertexSequence<Integer> authorities = graph.createVertexSequence(); PgxFuture<Pair<VertexSequence<Integer>, VertexSequence<Integer>>> promise = analyst.whomToFollowAsync( graph, vertex, 100, 500, 100, 0.001, 0.85, 100, 0.001, hubs, authorities); promise.thenAccept(wtf -> { wtf.getFirst(); wtf.getSecond(); });
- Time:
-
matrixFactorizationGradientDescentAsync
public <ID> PgxFuture<MatrixFactorizationModel<ID>> matrixFactorizationGradientDescentAsync(BipartiteGraph graph, EdgeProperty<java.lang.Double> weight)
Matrix factorization can be used as a recommendation algorithm for bipartite graphs
Definition
This algorithm needs a [bipartite](prog-guides/mutation-subgraph/subgraph.html#create-a-bipartite-subgraph-based-on-a-vertex-list) graph to generate feature vectors that factorize the given set of left vertices (users) and right vertices (items), so that the inner product of such feature vectors can recover the information from the original graph structure, which can be seen as a sparse matrix. The generated feature vectors can be used for making recommendations with the given set of users, where a good recommendation for a given user will be a dot (inner) product between the feature vector of the user and the corresponding feature vector of a vertex from the item set, such that the result of that dot product returns a high score.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(E * k * s) with E = number of edges, k = maximum number of iteration, s = size of the feature vectors
- Space:
O(2 * V * s) with V = number of vertices, s = size of the feature vectors
Default Values
Applications
- This algorithm can be used to get recommendations. The computed feature vectors can also be used to make predictions.
- Parameters:
graph
- Bipartite graph.weight
- edge property holding the rating weight of each edge in the graph. The weight needs to be pre-scaled into the range 1-5. If the weight values are not between 1 and 5, the result will become inaccurate.- Returns:
- Matrix factorization model holding the feature vectores found by the algorithm.
Examples
PgxGraph graph = ...; EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<MatrixFactorizationModel<Integer>> promise = analyst.matrixFactorizationGradientDescentAsync( graph, cost); promise.thenAccept(matrix -> { matrix.getRootMeanSquareError(); });
- See Also:
- Matrix factorization techniques for recommender systems
- Time:
-
matrixFactorizationGradientDescentAsync
public <ID> PgxFuture<MatrixFactorizationModel<ID>> matrixFactorizationGradientDescentAsync(BipartiteGraph graph, EdgeProperty<java.lang.Double> weight, double learningRate, double changePerStep, double lambda, int maxStep, int vectorLength)
Matrix factorization can be used as a recommendation algorithm for bipartite graphs
Definition
This algorithm needs a [bipartite](prog-guides/mutation-subgraph/subgraph.html#create-a-bipartite-subgraph-based-on-a-vertex-list) graph to generate feature vectors that factorize the given set of left vertices (users) and right vertices (items), so that the inner product of such feature vectors can recover the information from the original graph structure, which can be seen as a sparse matrix. The generated feature vectors can be used for making recommendations with the given set of users, where a good recommendation for a given user will be a dot (inner) product between the feature vector of the user and the corresponding feature vector of a vertex from the item set, such that the result of that dot product returns a high score.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(E * k * s) with E = number of edges, k = maximum number of iteration, s = size of the feature vectors
- Space:
O(2 * V * s) with V = number of vertices, s = size of the feature vectors
Default Values
Applications
- This algorithm can be used to get recommendations. The computed feature vectors can also be used to make predictions.
- Parameters:
graph
- Bipartite graph.weight
- edge property holding the rating weight of each edge in the graph. The weight needs to be pre-scaled into the range 1-5. If the weight values are not between 1 and 5, the result will become inaccurate.learningRate
- learning rate for the optimization process.changePerStep
- parameter used to modulate the learning rate during the optimization process.lambda
- penalization parameter to avoid overfitting during optimization process.maxStep
- maximum number of iterations that will be performed.vectorLength
- size of the feature vectors to be generated for the factorization.- Returns:
- Matrix factorization model holding the feature vectores found by the algorithm.
Examples
PgxGraph graph = ...; EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<MatrixFactorizationModel<Integer>> promise = analyst.matrixFactorizationGradientDescentAsync( graph, cost, 0.1, 0.9, 0.1, 100, 20); promise.thenAccept(matrix -> { matrix.getRootMeanSquareError(); });
- See Also:
- Matrix factorization techniques for recommender systems
- Time:
-
matrixFactorizationGradientDescentAsync
public <ID> PgxFuture<MatrixFactorizationModel<ID>> matrixFactorizationGradientDescentAsync(BipartiteGraph graph, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,PgxVect<java.lang.Double>> features)
Matrix factorization can be used as a recommendation algorithm for bipartite graphs
Definition
This algorithm needs a [bipartite](prog-guides/mutation-subgraph/subgraph.html#create-a-bipartite-subgraph-based-on-a-vertex-list) graph to generate feature vectors that factorize the given set of left vertices (users) and right vertices (items), so that the inner product of such feature vectors can recover the information from the original graph structure, which can be seen as a sparse matrix. The generated feature vectors can be used for making recommendations with the given set of users, where a good recommendation for a given user will be a dot (inner) product between the feature vector of the user and the corresponding feature vector of a vertex from the item set, such that the result of that dot product returns a high score.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(E * k * s) with E = number of edges, k = maximum number of iteration, s = size of the feature vectors
- Space:
O(2 * V * s) with V = number of vertices, s = size of the feature vectors
Default Values
Applications
- This algorithm can be used to get recommendations. The computed feature vectors can also be used to make predictions.
- Parameters:
graph
- Bipartite graph.weight
- edge property holding the rating weight of each edge in the graph. The weight needs to be pre-scaled into the range 1-5. If the weight values are not between 1 and 5, the result will become inaccurate.features
- (out argument) vertex property holding the generated feature vectors for each vertex.- Returns:
- Matrix factorization model holding the feature vectores found by the algorithm.
Examples
PgxGraph graph = ...; EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, PgxVect<Double>> features = graph.createVertexVectorProperty(PropertyType.DOUBLE, 20); PgxFuture<MatrixFactorizationModel<Integer>> promise = analyst.matrixFactorizationGradientDescentAsync( graph, cost, features); promise.thenAccept(matrix -> { matrix.getRootMeanSquareError(); });
- See Also:
- Matrix factorization techniques for recommender systems
- Time:
-
matrixFactorizationGradientDescentAsync
public <ID> PgxFuture<MatrixFactorizationModel<ID>> matrixFactorizationGradientDescentAsync(BipartiteGraph graph, EdgeProperty<java.lang.Double> weight, double learningRate, double changePerStep, double lambda, int maxStep, int vectorLength, VertexProperty<ID,PgxVect<java.lang.Double>> features)
Matrix factorization can be used as a recommendation algorithm for bipartite graphs
Definition
This algorithm needs a [bipartite](prog-guides/mutation-subgraph/subgraph.html#create-a-bipartite-subgraph-based-on-a-vertex-list) graph to generate feature vectors that factorize the given set of left vertices (users) and right vertices (items), so that the inner product of such feature vectors can recover the information from the original graph structure, which can be seen as a sparse matrix. The generated feature vectors can be used for making recommendations with the given set of users, where a good recommendation for a given user will be a dot (inner) product between the feature vector of the user and the corresponding feature vector of a vertex from the item set, such that the result of that dot product returns a high score.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(E * k * s) with E = number of edges, k = maximum number of iteration, s = size of the feature vectors
- Space:
O(2 * V * s) with V = number of vertices, s = size of the feature vectors
Default Values
Applications
- This algorithm can be used to get recommendations. The computed feature vectors can also be used to make predictions.
- Parameters:
graph
- Bipartite graph.weight
- edge property holding the rating weight of each edge in the graph. The weight needs to be pre-scaled into the range 1-5. If the weight values are not between 1 and 5, the result will become inaccurate.learningRate
- learning rate for the optimization process.changePerStep
- parameter used to modulate the learning rate during the optimization process.lambda
- penalization parameter to avoid overfitting during optimization process.maxStep
- maximum number of iterations that will be performed.vectorLength
- size of the feature vectors to be generated for the factorization.features
- (out argument) vertex property holding the generated feature vectors for each vertex.- Returns:
- Matrix factorization model holding the feature vectores found by the algorithm.
Examples
PgxGraph graph = ...; EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, PgxVect<Double>> features = graph.createVertexVectorProperty(PropertyType.DOUBLE, 20); PgxFuture<MatrixFactorizationModel<Integer>> promise = analyst.matrixFactorizationGradientDescentAsync( graph, cost, 0.1, 0.9, 0.1, 100, 20, features); promise.thenAccept(matrix -> { matrix.getRootMeanSquareError(); });
- See Also:
- Matrix factorization techniques for recommender systems
- Time:
-
matrixFactorizationRecommendationsAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> matrixFactorizationRecommendationsAsync(BipartiteGraph graph, PgxVertex<ID> user, int vectorLength, VertexProperty<ID,PgxVect<java.lang.Double>> feature, VertexProperty<ID,java.lang.Double> estimatedRating)
Estimate rating can be used as a prediction algorithm for bipartite graphs
Definition
This algorithm is a complement for Matrix Factorization, thus it needs a bipartite graph and the generated feature vectors from such algorithm. The generated feature vectors will be used for making predictions in cases where the given user vertex has not been related to a particular item from the item set. Similarly to the recommendations from matrix factorization, this algorithm will perform dot products between the given user vertex and the rest of vertices in the graph, giving a score of 0 to the items that are already related to the user and to the products with other user vertices, hence returning the results of the dot products for the unrelated item vertices. The scores from those dot products can be interpreted as the predicted scores for the unrelated items given a particular user vertex.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- This algorithm uses computed feature vectors from Matrix Factorization to make predictions about unrelated vertices from the item set (right vertices in the bipartite graph.
- Parameters:
graph
- the graph.user
- vertex from the left (user) side of the graph.vectorLength
- size of the feature vectors.feature
- vertex property holding the feature vectors for each vertex.estimatedRating
- (out argument) vertex property holding the estimated rating score for each vertex.- Returns:
- vertex property holding the estimated rating score for each vertex.
- See Also:
- Matrix factorization techniques for recommender systems
- Time:
-
fattestPathAsync
public <ID> PgxFuture<AllPaths<ID>> fattestPathAsync(PgxGraph graph, PgxVertex<ID> root, EdgeProperty<java.lang.Double> capacity)
Fattest path is a fast algorithm for finding a shortest path adding constraints for flowing related matters
Definition
The Fattest path algorithm can be regarded as a variant of Dijkstra's algorithm, it tries to find the fattest path between the given source and all the reachable vertices in the graph. The fatness of a path is equal to the minimum value of the capacity from the edges that take part in the path, thus a fattest path is conformed by the edges with the largest possible capacity.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(4 * V) with V = number of vertices
Default Values
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.capacity
- edge property holding the capacity of each edge in the graph.- Returns:
- AllPaths holding the information of the possible fattest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> root = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<AllPaths<Integer>> promise = analyst.fattestPathAsync(graph, root, cost); promise.thenAccept(paths -> { ...; });
- Time:
-
fattestPathAsync
public <ID> PgxFuture<AllPaths<ID>> fattestPathAsync(PgxGraph graph, PgxVertex<ID> root, EdgeProperty<java.lang.Double> capacity, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Fattest path is a fast algorithm for finding a shortest path adding constraints for flowing related matters
Definition
The Fattest path algorithm can be regarded as a variant of Dijkstra's algorithm, it tries to find the fattest path between the given source and all the reachable vertices in the graph. The fatness of a path is equal to the minimum value of the capacity from the edges that take part in the path, thus a fattest path is conformed by the edges with the largest possible capacity.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(4 * V) with V = number of vertices
Default Values
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.capacity
- edge property holding the capacity of each edge in the graph.distance
- (out argument) vertex property holding the capacity value of the fattest path up to the current vertex. The fatness value for the source vertex will be INF, while it will be 0 for all the vertices that are not reachable from the source.parent
- (out argument) vertex property holding the parent vertex of the each vertex in the fattest path.parentEdge
- (out argument) vertex property holding the edge ID linking the current vertex in the path with the previous vertex in the path.- Returns:
- AllPaths holding the information of the possible fattest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> root = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> distance = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); PgxFuture<AllPaths<Integer>> promise = analyst.fattestPathAsync(graph, root, cost, distance, parent, parentEdge); promise.thenAccept(paths -> { ...; });
- Time:
-
fattestPathAsync
public <ID> PgxFuture<AllPaths<ID>> fattestPathAsync(PgxGraph graph, PgxVertex<ID> root, EdgeProperty<java.lang.Double> capacity, boolean ignoreEdgeDirection)
Undirected Fattest path is variation of the fattest graph algorithm that ignores edge directions. for flowing related matters
Definition
The Fattest path algorithm can be regarded as a variant of Dijkstra's algorithm, it tries to find the fattest path between the given source and all the reachable vertices in the graph. The fatness of a path is equal to the minimum value of the capacity from the edges that take part in the path, thus a fattest path is conformed by the edges with the largest possible capacity.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(4 * V) with V = number of vertices
Default Values
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.capacity
- edge property holding the capacity of each edge in the graph.ignoreEdgeDirection
- boolean flag for ignoring the direction of the edges during the search.- Returns:
- AllPaths holding the information of the possible fattest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> root = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<AllPaths<Integer>> promise = analyst.fattestPathAsync(graph, root, cost, true); promise.thenAccept(paths -> { ...; });
- Time:
-
fattestPathAsync
public <ID> PgxFuture<AllPaths<ID>> fattestPathAsync(PgxGraph graph, PgxVertex<ID> root, EdgeProperty<java.lang.Double> capacity, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge, boolean ignoreEdgeDirection)
Undirected Fattest path is variation of the fattest graph algorithm that ignores edge directions. for flowing related matters
Definition
The Fattest path algorithm can be regarded as a variant of Dijkstra's algorithm, it tries to find the fattest path between the given source and all the reachable vertices in the graph. The fatness of a path is equal to the minimum value of the capacity from the edges that take part in the path, thus a fattest path is conformed by the edges with the largest possible capacity.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(4 * V) with V = number of vertices
Default Values
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.capacity
- edge property holding the capacity of each edge in the graph.distance
- (out argument) vertex property holding the capacity value of the fattest path up to the current vertex. The fatness value for the source vertex will be INF, while it will be 0 for all the vertices that are not reachable from the source.parent
- (out argument) vertex property holding the parent vertex of the each vertex in the fattest path.parentEdge
- (out argument) vertex property holding the edge ID linking the current vertex in the path with the previous vertex in the path.ignoreEdgeDirection
- boolean flag for ignoring the direction of the edges during the search.- Returns:
- AllPaths holding the information of the possible fattest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> root = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> distance = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); PgxFuture<AllPaths<Integer>> promise = analyst.fattestPathAsync(graph, root, cost, distance, parent, parentEdge, ignoreEdgeDirection); promise.thenAccept(paths -> { ...; });
- Time:
-
shortestPathDijkstraAsync
public <ID> PgxFuture<PgxPath<ID>> shortestPathDijkstraAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost)
Dijkstra is a fast algorithm for finding a shortest path in a graph
Definition
Dijkstra's algorithm tries to find the shortest path (if there is one) between the given source and destination vertices, while minimizing the distance or cost associated to each edge in the graph.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(4 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
- the graph.src
- the source vertex from the graph for the path.dst
- the destination vertex from the graph for the path.cost
- edge property holding the (positive) weight of each edge in the graph.- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<PgxPath<Integer>> promise = analyst.shortestPathDijkstraAsync(graph, src, dst, cost); promise.thenAccept(path -> { path.getPathLengthWithCost(); });
- Time:
-
shortestPathDijkstraAsync
public <ID> PgxFuture<PgxPath<ID>> shortestPathDijkstraAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Dijkstra is a fast algorithm for finding a shortest path in a graph
Definition
Dijkstra's algorithm tries to find the shortest path (if there is one) between the given source and destination vertices, while minimizing the distance or cost associated to each edge in the graph.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(4 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
- the graph.src
- the source vertex from the graph for the path.dst
- the destination vertex from the graph for the path.cost
- edge property holding the (positive) weight of each edge in the graph.parent
- (out argument) vertex property holding the parent vertex of the each vertex in the shortest path.parentEdge
- (out argument) vertex property holding the edge ID linking the current vertex in the path with the previous vertex in the path.- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); PgxFuture<PgxPath<Integer>> promise = analyst.shortestPathDijkstraAsync(graph, src, dst, cost, parent, parentEdge); promise.thenAccept(path -> { path.getPathLengthWithCost(); });
- Time:
-
shortestPathFilteredDijkstraAsync
public <ID> PgxFuture<PgxPath<ID>> shortestPathFilteredDijkstraAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr)
Filtered Dijkstra is a fast algorithm for finding a shortest path while also filtering edges
Definition
This variant of the Dijkstra's algorithm tries to find the shortest path while also taking into account a filter expression, which will add restrictions over the potential edges when looking for the shortest path between the source and destination vertices.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(4 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
-src
-dst
-cost
-filterExpr
-- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); EdgeFilter filter = EdgeFilter.fromExpression("edge.cost > 5"); PgxFuture<PgxPath<Integer>> promise = analyst.shortestPathFilteredDijkstraAsync(graph, src, dst, cost, filter); promise.thenAccept(path -> { path.getPathLengthWithCost(); });
- Time:
-
shortestPathFilteredDijkstraAsync
public <ID> PgxFuture<PgxPath<ID>> shortestPathFilteredDijkstraAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Filtered Dijkstra is a fast algorithm for finding a shortest path while also filtering edges
Definition
This variant of the Dijkstra's algorithm tries to find the shortest path while also taking into account a filter expression, which will add restrictions over the potential edges when looking for the shortest path between the source and destination vertices.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(4 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
-src
-dst
-cost
-filterExpr
-parent
- (out argument)parentEdge
- (out argument)- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); EdgeFilter filter = EdgeFilter.fromExpression("edge.cost > 5"); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); PgxFuture<PgxPath<Integer>> promise = analyst.shortestPathFilteredDijkstraAsync( graph, src, dst, cost, filter, parent, parentEdge); promise.thenAccept(path -> { path.getPathLengthWithCost(); });
- Time:
-
shortestPathFilteredDijkstraAsync
public <ID> PgxFuture<PgxPath<ID>> shortestPathFilteredDijkstraAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, boolean ignoreEdgeDirection)
Undirected filtered djkstra is variation of the filtered djkstra's algorithm that ignores edge directions.
Definition
This variant of the Dijkstra's algorithm tries to find the shortest path ignoring edges directions for directed graphs while also taking into account a filter expression, which will add restrictions over the potential edges when looking for the shortest path between the source and destination vertices .
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(4 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
-src
-dst
-cost
-filterExpr
-ignoreEdgeDirection
- boolean flag for ignoring the direction of the edges during the search.- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); EdgeFilter filter = EdgeFilter.fromExpression("edge.cost > 5"); PgxFuture<PgxPath<Integer>> promise = analyst.shortestPathFilteredDijkstraAsync(graph, src, dst, cost, filter); promise.thenAccept(path -> { path.getPathLengthWithCost(); });
- Time:
-
shortestPathFilteredDijkstraAsync
public <ID> PgxFuture<PgxPath<ID>> shortestPathFilteredDijkstraAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge, boolean ignoreEdgeDirection)
Undirected filtered djkstra is variation of the filtered djkstra's algorithm that ignores edge directions.
Definition
This variant of the Dijkstra's algorithm tries to find the shortest path ignoring edges directions for directed graphs while also taking into account a filter expression, which will add restrictions over the potential edges when looking for the shortest path between the source and destination vertices .
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(4 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
-src
-dst
-cost
-filterExpr
-parent
- (out argument)parentEdge
- (out argument)ignoreEdgeDirection
- boolean flag for ignoring the direction of the edges.- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); EdgeFilter filter = EdgeFilter.fromExpression("edge.cost > 5"); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); PgxFuture<PgxPath<Integer>> promise = analyst.shortestPathFilteredDijkstraAsync( graph, src, dst, cost, filter, parent, parentEdge); promise.thenAccept(path -> { path.getPathLengthWithCost(); });
- Time:
-
shortestPathDijkstraAsync
public <ID> PgxFuture<PgxPath<ID>> shortestPathDijkstraAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, boolean ignoreEdgeDirection)
Undirected Dijkstra's algorithm is a variant of Dijkstra's algorithm that ignores edge directions.
Definition
Dijkstra's algorithm tries to find the shortest path (if there is one) between the given source and destination vertices, while minimizing the distance or cost associated to each edge in the graph.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(4 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
- the graph.src
- the source vertex from the graph for the path.dst
- the destination vertex from the graph for the path.cost
- edge property holding the (positive) weight of each edge in the graph.ignoreEdgeDirection
- boolean flag for ignoring the direction of the edges during the search.- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<PgxPath<Integer>> promise = analyst.shortestPathDijkstraAsync(graph, src, dst, cost); promise.thenAccept(path -> { path.getPathLengthWithCost(); });
- Time:
-
shortestPathDijkstraAsync
public <ID> PgxFuture<PgxPath<ID>> shortestPathDijkstraAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge, boolean ignoreEdgeDirection)
Undirected Dijkstra's algorithm is a variant of Dijkstra's algorithm that ignores edge directions.
Definition
Dijkstra's algorithm tries to find the shortest path (if there is one) between the given source and destination vertices, while minimizing the distance or cost associated to each edge in the graph.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(4 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
- the graph.src
- the source vertex from the graph for the path.dst
- the destination vertex from the graph for the path.cost
- edge property holding the (positive) weight of each edge in the graph.parent
- (out argument) vertex property holding the parent vertex of the each vertex in the shortest path.parentEdge
- (out argument) vertex property holding the edge ID linking the current vertex in the path with the previous vertex in the path.ignoreEdgeDirection
- boolean flag for ignoring the direction of the edges during the search.- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); PgxFuture<PgxPath<Integer>> promise = analyst.shortestPathDijkstraAsync(graph, src, dst, cost, parent, parentEdge); promise.thenAccept(path -> { path.getPathLengthWithCost(); });
- Time:
-
shortestPathMultiDestinationDijkstraAsync
public <ID> PgxFuture<AllPaths<ID>> shortestPathMultiDestinationDijkstraAsync(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost)
Dijkstra is a fast algorithm for finding a shortest path in a graph and goes to all destinations.
Definition
This variant of the Dijkstra's algorithm tries to find the shortest path (if there is one) which goes from a single source to all destinations, while minimizing the distance or cost associated to each edge in the graph.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(4 * V) with V = number of vertices
Default Values
- src: 0
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
- the graph.src
- the source vertex from the graph for the path.cost
- edge property holding the (positive) weight of each edge in the graph.- Returns:
- AllPaths holding the information of the possible shortest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<AllPaths<Integer>> promise = analyst.shortestPathMultiDestinationDijkstraAsync(graph, src, cost); promise.thenAccept(paths -> { ...; });
- Time:
-
shortestPathMultiDestinationDijkstraAsync
public <ID> PgxFuture<AllPaths<ID>> shortestPathMultiDestinationDijkstraAsync(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Dijkstra is a fast algorithm for finding a shortest path in a graph and goes to all destinations.
Definition
This variant of the Dijkstra's algorithm tries to find the shortest path (if there is one) which goes from a single source to all destinations, while minimizing the distance or cost associated to each edge in the graph.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(4 * V) with V = number of vertices
Default Values
- src: 0
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
- the graph.src
- the source vertex from the graph for the path.cost
- edge property holding the (positive) weight of each edge in the graph.distance
- (out argument) vertex property holding the distance to the source vertex for each vertex in the graph.parent
- (out argument) vertex property holding the parent vertex of the each vertex in the shortest path.parentEdge
- (out argument) vertex property holding the edge ID linking the current vertex in the path with the previous vertex in the path.- Returns:
- AllPaths holding the information of the possible shortest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> distance = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); PgxFuture<AllPaths<Integer>> promise = analyst.shortestPathMultiDestinationDijkstraAsync(graph, src, cost, distance, parent, parentEdge); promise.thenAccept(path -> { path.getPathLengthWithCost(); });
- Time:
-
shortestPathDijkstraBidirectionalAsync
public <ID> PgxFuture<PgxPath<ID>> shortestPathDijkstraBidirectionalAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost)
Bidirectional dijkstra is a fast algorithm for finding a shortest path in a graph
Definition
This variant of the Dijkstra's algorithm searches for shortest path in two ways, it does a forward search from the source vertex and a backwards one from the destination vertex. If the path between the vertices exists, both searches will meet each other at an intermediate point.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(10 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
-src
-dst
-cost
-- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<PgxPath<Integer>> promise = analyst.shortestPathDijkstraBidirectionalAsync(graph, src, dst, cost); promise.thenAccept(path -> { path.getPathLengthWithCost(); });
- Time:
-
shortestPathDijkstraBidirectionalAsync
public <ID> PgxFuture<PgxPath<ID>> shortestPathDijkstraBidirectionalAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Bidirectional dijkstra is a fast algorithm for finding a shortest path in a graph
Definition
This variant of the Dijkstra's algorithm searches for shortest path in two ways, it does a forward search from the source vertex and a backwards one from the destination vertex. If the path between the vertices exists, both searches will meet each other at an intermediate point.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(10 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
-src
-dst
-cost
-parent
- (out argument)parentEdge
- (out argument)- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); PgxFuture<PgxPath<Integer>> promise = analyst.shortestPathDijkstraBidirectionalAsync( graph, src, dst, cost, parent, parentEdge); promise.thenAccept(path -> { path.getPathLengthWithCost(); });
- Time:
-
shortestPathDijkstraBidirectionalAsync
public <ID> PgxFuture<PgxPath<ID>> shortestPathDijkstraBidirectionalAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, java.lang.String parentName, java.lang.String parentEdgeName)
-
shortestPathDijkstraBidirectionalAsync
public <ID> PgxFuture<PgxPath<ID>> shortestPathDijkstraBidirectionalAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, boolean ignoreEdgeDirection)
Undirected bidirectional dijkstra is a variant of bidirectional dijkstra that ignores edge directions
Definition
This variant of the Dijkstra's algorithm searches for shortest path in two ways, it does a forward search from the source vertex and a backwards one from the destination vertex. If the path between the vertices exists, both searches will meet each other at an intermediate point.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(10 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
-src
-dst
-cost
-ignoreEdgeDirection
- boolean flag for ignoring the direction of the edges during the search.- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<PgxPath<Integer>> promise = analyst.shortestPathDijkstraBidirectionalAsync(graph, src, dst, cost); promise.thenAccept(path -> { path.getPathLengthWithCost(); });
- Time:
-
shortestPathDijkstraBidirectionalAsync
public <ID> PgxFuture<PgxPath<ID>> shortestPathDijkstraBidirectionalAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge, boolean ignoreEdgeDirection)
Undirected bidirectional dijkstra is a variant of bidirectional dijkstra that ignores edge directions
Definition
This variant of the Dijkstra's algorithm searches for shortest path in two ways, it does a forward search from the source vertex and a backwards one from the destination vertex. If the path between the vertices exists, both searches will meet each other at an intermediate point.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(10 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
-src
-dst
-cost
-parent
- (out argument)parentEdge
- (out argument)ignoreEdgeDirection
- boolean flag for ignoring the direction of the edges during the search.- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); PgxFuture<PgxPath<Integer>> promise = analyst.shortestPathDijkstraBidirectionalAsync( graph, src, dst, cost, parent, parentEdge); promise.thenAccept(path -> { path.getPathLengthWithCost(); });
- Time:
-
shortestPathDijkstraBidirectionalAsync
public <ID> PgxFuture<PgxPath<ID>> shortestPathDijkstraBidirectionalAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, java.lang.String parentName, java.lang.String parentEdgeName, boolean ignoreEdgeDirection)
-
shortestPathFilteredDijkstraBidirectionalAsync
public <ID> PgxFuture<PgxPath<ID>> shortestPathFilteredDijkstraBidirectionalAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr)
Bidirectional dijkstra is a fast algorithm for finding a shortest path while also filtering edges
Definition
This variant of the Dijkstra's algorithm searches for shortest path in two ways, it does a forward search from the source vertex and a backwards one from the destination vertex, while also adding the corresponding restrictions on the edges given by the filter expression. If the path between the vertices exists, both searches will meet each other at an intermediate point.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(10 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
-src
-dst
-cost
-filterExpr
-- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); EdgeFilter filter = EdgeFilter.fromExpression("edge.cost > 5"); PgxFuture<PgxPath<Integer>> promise = analyst.shortestPathFilteredDijkstraBidirectionalAsync( graph, src, dst, cost, filter); promise.thenAccept(path -> { path.getPathLengthWithCost(); });
- Time:
-
shortestPathFilteredDijkstraBidirectionalAsync
public <ID> PgxFuture<PgxPath<ID>> shortestPathFilteredDijkstraBidirectionalAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Bidirectional dijkstra is a fast algorithm for finding a shortest path while also filtering edges
Definition
This variant of the Dijkstra's algorithm searches for shortest path in two ways, it does a forward search from the source vertex and a backwards one from the destination vertex, while also adding the corresponding restrictions on the edges given by the filter expression. If the path between the vertices exists, both searches will meet each other at an intermediate point.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(10 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
-src
-dst
-cost
-filterExpr
-parent
- (out argument)parentEdge
- (out argument)- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); EdgeFilter filter = EdgeFilter.fromExpression("edge.cost > 5"); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); PgxFuture<PgxPath<Integer>> promise = analyst.shortestPathFilteredDijkstraBidirectionalAsync( graph, src, dst, cost, filter, parent, parentEdge); promise.thenAccept(path -> { path.getPathLengthWithCost(); });
- Time:
-
shortestPathFilteredDijkstraBidirectionalAsync
public <ID> PgxFuture<PgxPath<ID>> shortestPathFilteredDijkstraBidirectionalAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, java.lang.String parentName, java.lang.String parentEdgeName)
-
shortestPathFilteredDijkstraBidirectionalAsync
public <ID> PgxFuture<PgxPath<ID>> shortestPathFilteredDijkstraBidirectionalAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, boolean ignoreEdgeDirection)
Bidirectional dijkstra is a fast algorithm for finding a shortest path while also filtering edges
Definition
This variant of the Dijkstra's algorithm searches for shortest path in two ways, it does a forward search from the source vertex and a backwards one from the destination vertex, while also adding the corresponding restrictions on the edges given by the filter expression. If the path between the vertices exists, both searches will meet each other at an intermediate point.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(10 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
-src
-dst
-cost
-filterExpr
-ignoreEdgeDirection
- boolean flag for ignoring the direction of the edges- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); EdgeFilter filter = EdgeFilter.fromExpression("edge.cost > 5"); PgxFuture<PgxPath<Integer>> promise = analyst.shortestPathFilteredDijkstraBidirectionalAsync( graph, src, dst, cost, filter); promise.thenAccept(path -> { path.getPathLengthWithCost(); });
- Time:
-
shortestPathFilteredDijkstraBidirectionalAsync
public <ID> PgxFuture<PgxPath<ID>> shortestPathFilteredDijkstraBidirectionalAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge, boolean ignoreEdgeDirection)
Bidirectional dijkstra is a fast algorithm for finding a shortest path while also filtering edges
Definition
This variant of the Dijkstra's algorithm searches for shortest path in two ways, it does a forward search from the source vertex and a backwards one from the destination vertex, while also adding the corresponding restrictions on the edges given by the filter expression. If the path between the vertices exists, both searches will meet each other at an intermediate point.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(10 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
-src
-dst
-cost
-filterExpr
-parent
- (out argument)parentEdge
- (out argument)ignoreEdgeDirection
- boolean flag for ignoring the direction of the edges- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); EdgeFilter filter = EdgeFilter.fromExpression("edge.cost > 5"); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); PgxFuture<PgxPath<Integer>> promise = analyst.shortestPathFilteredDijkstraBidirectionalAsync( graph, src, dst, cost, filter, parent, parentEdge); promise.thenAccept(path -> { path.getPathLengthWithCost(); });
- Time:
-
shortestPathFilteredDijkstraBidirectionalAsync
public <ID> PgxFuture<PgxPath<ID>> shortestPathFilteredDijkstraBidirectionalAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, java.lang.String parentName, java.lang.String parentEdgeName, boolean ignoreEdgeDirection)
-
shortestPathBellmanFordAsync
public <ID> PgxFuture<AllPaths<ID>> shortestPathBellmanFordAsync(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost)
Bellman-ford finds multiple shortest paths at the same time
Definition
Bellman-Ford algorithm tries to find the shortest path (if there is one) between the given source and destination vertices, while minimizing the distance or cost associated to each edge in the graph.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(6 * V) with V = number of vertices
Default Values
- root: 0
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
- the graph.src
- the source vertex from the graph for the path.cost
- edge property holding the weight of each edge in the graph.- Returns:
- AllPaths holding the information of the possible shortest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<AllPaths<Integer>> promise = analyst.shortestPathBellmanFordAsync(graph, src, cost); promise.thenAccept(paths -> { ...; });
- Time:
-
shortestPathBellmanFordAsync
public <ID> PgxFuture<AllPaths<ID>> shortestPathBellmanFordAsync(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Bellman-ford finds multiple shortest paths at the same time
Definition
Bellman-Ford algorithm tries to find the shortest path (if there is one) between the given source and destination vertices, while minimizing the distance or cost associated to each edge in the graph.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(6 * V) with V = number of vertices
Default Values
- root: 0
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
- the graph.src
- the source vertex from the graph for the path.cost
- edge property holding the weight of each edge in the graph.distance
- (out argument) vertex property holding the distance to the source vertex for each vertex in the graph.parent
- (out argument) vertex property holding the parent vertex of the each vertex in the shortest path.parentEdge
- (out argument) vertex property holding the edge ID linking the current vertex in the path with the previous vertex in the path.- Returns:
- AllPaths holding the information of the possible shortest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> distance = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); PgxFuture<AllPaths<Integer>> promise = analyst.shortestPathBellmanFordAsync( graph, src, cost, distance, parent, parentEdge); promise.thenAccept(paths -> { ...; });
- Time:
-
shortestPathBellmanFordAsync
public <ID> PgxFuture<AllPaths<ID>> shortestPathBellmanFordAsync(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost, boolean ignoreEdgeDirection)
Bellman-ford finds multiple shortest paths at the same time
Definition
Bellman-Ford algorithm tries to find the shortest path (if there is one) between the given source and destination vertices, while minimizing the distance or cost associated to each edge in the graph.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(6 * V) with V = number of vertices
Default Values
- root: 0
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
- the graph.src
- the source vertex from the graph for the path.cost
- edge property holding the weight of each edge in the graph.ignoreEdgeDirection
- boolean flag for ignoring the direction of the edges during the search.- Returns:
- AllPaths holding the information of the possible shortest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<AllPaths<Integer>> promise = analyst.shortestPathBellmanFordAsync(graph, src, cost, true); promise.thenAccept(paths -> { ...; });
- Time:
-
shortestPathBellmanFordAsync
public <ID> PgxFuture<AllPaths<ID>> shortestPathBellmanFordAsync(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge, boolean ignoreEdgeDirection)
Bellman-ford finds multiple shortest paths at the same time
Definition
Bellman-Ford algorithm tries to find the shortest path (if there is one) between the given source and destination vertices, while minimizing the distance or cost associated to each edge in the graph.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(6 * V) with V = number of vertices
Default Values
- root: 0
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
- the graph.src
- the source vertex from the graph for the path.cost
- edge property holding the weight of each edge in the graph.distance
- (out argument) vertex property holding the distance to the source vertex for each vertex in the graph.parent
- (out argument) vertex property holding the parent vertex of the each vertex in the shortest path.parentEdge
- (out argument) vertex property holding the edge ID linking the current vertex in the path with the previous vertex in the path.ignoreEdgeDirection
- boolean flag for ignoring the direction of the edges during the search.- Returns:
- AllPaths holding the information of the possible shortest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> distance = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); PgxFuture<AllPaths<Integer>> promise = analyst.shortestPathBellmanFordAsync( graph, src, cost, distance, parent, parentEdge, true); promise.thenAccept(paths -> { ...; });
- Time:
-
shortestPathBellmanFordReverseAsync
public <ID> PgxFuture<AllPaths<ID>> shortestPathBellmanFordReverseAsync(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost)
Reversed bellman-ford finds multiple shortest paths at the same time
Definition
This variant of the Bellman-Ford algorithm tries to find the shortest path (if there is one) between the given source and destination vertices in a reversed fashion using the incoming edges instead of the outgoing, while minimizing the distance or cost associated to each edge in the graph.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(6 * V) with V = number of vertices
Default Values
- root: 0
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
-src
-cost
-- Returns:
- AllPaths holding the information of the possible shortest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<AllPaths<Integer>> promise = analyst.shortestPathBellmanFordReverseAsync(graph, src, cost); promise.thenAccept(paths -> { ...; });
- Time:
-
shortestPathBellmanFordReverseAsync
public <ID> PgxFuture<AllPaths<ID>> shortestPathBellmanFordReverseAsync(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Reversed bellman-ford finds multiple shortest paths at the same time
Definition
This variant of the Bellman-Ford algorithm tries to find the shortest path (if there is one) between the given source and destination vertices in a reversed fashion using the incoming edges instead of the outgoing, while minimizing the distance or cost associated to each edge in the graph.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(6 * V) with V = number of vertices
Default Values
- root: 0
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
-src
-cost
-distance
- (out argument)parent
- (out argument)parentEdge
- (out argument)- Returns:
- AllPaths holding the information of the possible shortest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> distance = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); PgxFuture<AllPaths<Integer>> promise = analyst.shortestPathBellmanFordReverseAsync( graph, src, cost, distance, parent, parentEdge); promise.thenAccept(paths -> { ...; });
- Time:
-
shortestPathHopDistAsync
public <ID> PgxFuture<AllPaths<ID>> shortestPathHopDistAsync(PgxGraph graph, PgxVertex<ID> src)
Hop distance can give a relatively fast insight on the distances in a graph
Definition
The Hop distance of two vertices S and V in a graph is the number of edges that are in a shortest path connecting them. This algorithm will return the distance of each vertex with respect to the given source vertex in the input and will also return the parent vertex and linking edge for each vertex. The returned information allows to trace back shortest paths from any reachable vertex to the source vertex.
Implementation Details
The implementation of this algorithm uses the built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- This algorithm computes a basic structural graph property that is useful when looking for distances in a graph.
- Parameters:
graph
-src
-- Returns:
- AllPaths holding the information of the possible shortest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxFuture<AllPaths<Integer>> promise = analyst.shortestPathHopDistAsync(graph, src); promise.thenAccept(paths -> { ...; });
- Time:
-
shortestPathHopDistAsync
public <ID> PgxFuture<AllPaths<ID>> shortestPathHopDistAsync(PgxGraph graph, PgxVertex<ID> src, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Hop distance can give a relatively fast insight on the distances in a graph
Definition
The Hop distance of two vertices S and V in a graph is the number of edges that are in a shortest path connecting them. This algorithm will return the distance of each vertex with respect to the given source vertex in the input and will also return the parent vertex and linking edge for each vertex. The returned information allows to trace back shortest paths from any reachable vertex to the source vertex.
Implementation Details
The implementation of this algorithm uses the built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- This algorithm computes a basic structural graph property that is useful when looking for distances in a graph.
- Parameters:
graph
-src
-distance
- (out argument)parent
- (out argument)parentEdge
- (out argument)- Returns:
- AllPaths holding the information of the possible shortest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); VertexProperty<Integer, Double> distance = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); PgxFuture<AllPaths<Integer>> promise = analyst.shortestPathHopDistAsync(graph, src, distance, parent, parentEdge); promise.thenAccept(paths -> { ...; });
- Time:
-
shortestPathHopDistReverseAsync
public <ID> PgxFuture<AllPaths<ID>> shortestPathHopDistReverseAsync(PgxGraph graph, PgxVertex<ID> src)
Backwards hop distance can give a relatively fast insight on the distances in a graph
Definition
The Hop distance of two vertices S and V in a graph is the number of edges that are in a shortest path connecting them. This algorithm will return the distance of each node with respect to the given source node in the input and will also return the parent node and linking edge for each node. The returned information allows to trace back shortest paths from any reachable node to the source node.
Implementation Details
The implementation of this algorithm uses the built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- This algorithm computes a basic structural graph property that is useful when looking for distances in a graph.
- Parameters:
graph
-src
-- Returns:
- AllPaths holding the information of the possible shortest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxFuture<AllPaths<Integer>> promise = analyst.shortestPathHopDistReverseAsync(graph, src); promise.thenAccept(paths -> { ...; });
- Time:
-
shortestPathHopDistReverseAsync
public <ID> PgxFuture<AllPaths<ID>> shortestPathHopDistReverseAsync(PgxGraph graph, PgxVertex<ID> src, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Backwards hop distance can give a relatively fast insight on the distances in a graph
Definition
The Hop distance of two vertices S and V in a graph is the number of edges that are in a shortest path connecting them. This algorithm will return the distance of each node with respect to the given source node in the input and will also return the parent node and linking edge for each node. The returned information allows to trace back shortest paths from any reachable node to the source node.
Implementation Details
The implementation of this algorithm uses the built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- This algorithm computes a basic structural graph property that is useful when looking for distances in a graph.
- Parameters:
graph
-src
-distance
- (out argument)parent
- (out argument)parentEdge
- (out argument)- Returns:
- AllPaths holding the information of the possible shortest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); VertexProperty<Integer, Double> distance = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); PgxFuture<AllPaths<Integer>> promise = analyst.shortestPathHopDistReverseAsync( graph, src, distance, parent, parentEdge); promise.thenAccept(paths -> { ...; });
- Time:
-
shortestPathHopDistUndirectedAsync
public <ID> PgxFuture<AllPaths<ID>> shortestPathHopDistUndirectedAsync(PgxGraph graph, PgxVertex<ID> src)
Undirected hop distance can give a relatively fast insight on the distances in a graph
Definition
The Hop distance of two vertices S and V in a graph is the number of edges that are in a shortest path connecting them. This algorithm will return the distance of each node with respect to the given source node in the input and will also return the parent node and linking edge for each node. The returned information allows to trace back shortest paths from any reachable node to the source node.
Implementation Details
The implementation of this algorithm uses the built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- This algorithm computes a basic structural graph property that is useful when looking for distances in a graph.
- Parameters:
graph
-src
-- Returns:
- AllPaths holding the information of the possible shortest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxFuture<AllPaths<Integer>> promise = analyst.shortestPathHopDistUndirectedAsync(graph, src); promise.thenAccept(paths -> { ...; });
- Time:
-
shortestPathHopDistUndirectedAsync
public <ID> PgxFuture<AllPaths<ID>> shortestPathHopDistUndirectedAsync(PgxGraph graph, PgxVertex<ID> src, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge)
Undirected hop distance can give a relatively fast insight on the distances in a graph
Definition
The Hop distance of two vertices S and V in a graph is the number of edges that are in a shortest path connecting them. This algorithm will return the distance of each node with respect to the given source node in the input and will also return the parent node and linking edge for each node. The returned information allows to trace back shortest paths from any reachable node to the source node.
Implementation Details
The implementation of this algorithm uses the built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- This algorithm computes a basic structural graph property that is useful when looking for distances in a graph.
- Parameters:
graph
-src
-distance
- (out argument)parent
- (out argument)parentEdge
- (out argument)- Returns:
- AllPaths holding the information of the possible shortest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); VertexProperty<Integer, Double> distance = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); PgxFuture<AllPaths<Integer>> promise = analyst.shortestPathHopDistUndirectedAsync( graph, src, distance, parent, parentEdge); promise.thenAccept(paths -> { ...; });
- Time:
-
countTrianglesAsync
public PgxFuture<java.lang.Long> countTrianglesAsync(PgxGraph graph, boolean sortVerticesByDegree)
triangle counting gives an overview of the amount of connections between vertices in neighborhoods
Definition
This algorithm is intended for directed graphs and will count all the existing triangles on it. To run the algorithm on undirected graphs, use the undirected version.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(E ^ 1.5) with E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Triangles in graphs can be used as a measure of the quality in social networks, they can help to find communities within graphs.
- Parameters:
graph
- the graph.sortVerticesByDegree
- boolean flag for sorting the nodes by their degree as preprocessing step.- Returns:
- returns the total number of triangles found.
Examples
PgxGraph graph = ...; PgxFuture<Long> promise = analyst.countTrianglesAsync(graph, true); promise.thenAccept(result -> { ...; });
- Time:
-
kcoreAsync
public <ID> PgxFuture<Pair<Scalar<java.lang.Long>,VertexProperty<ID,java.lang.Long>>> kcoreAsync(PgxGraph graph)
k-core decomposes a graph into layers revealing subgraphs with particular properties
Definition
A k-core is a maximal subgraph in which all of its vertices are connected and have the property that all of them have a degree of at least k. The k-cores can be regarded as layers in a graph, since a (k+1)-core will always be a subgraph of a k-core. This means that the larger k becomes, the smaller its k-core (i.e. its corresponding subgraph) will be. The k-core value (or coreness) assigned to a vertex will correspond to the core with the greatest degree from all the cores where it belongs. This implementation of k-core will look for cores lying within the interval set by the min_core and max_core input variables.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- K-Core can be used to analyze hierarchical structures in a graph by revealing subgraphs with particular properties. It can also help to visualize large graphs in 2D by using the "layers" provided by the k-cores.
- Parameters:
graph
- the graph.- Returns:
- Pair holding the maximum core found and a node property with the largest k-core value for each node.
Examples
PgxGraph graph = ...; PgxFuture<Pair<Scalar<Long>, VertexProperty<Integer, Long>>> promise = analyst.kcoreAsync(graph); promise.thenCompose(kcore -> { kcore.getFirst().get(); graph.queryPgqlAsync( "SELECT x, x." + kcore.getSecond().getName() + " MATCH (x) ORDER BY x." + kcore.getSecond().getName() + " DESC")) .thenAccept(PgqlResultSet::print); });
- See Also:
- An O(m) Algorithm for Cores Decomposition of Networks, k-core decomposition: a tool for the visualization of large scale networks
- Time:
-
kcoreAsync
public <ID> PgxFuture<Pair<Scalar<java.lang.Long>,VertexProperty<ID,java.lang.Long>>> kcoreAsync(PgxGraph graph, int minCore, int maxCore, Scalar<java.lang.Long> maxKCore, VertexProperty<ID,java.lang.Long> kcore)
k-core decomposes a graph into layers revealing subgraphs with particular properties
Definition
A k-core is a maximal subgraph in which all of its vertices are connected and have the property that all of them have a degree of at least k. The k-cores can be regarded as layers in a graph, since a (k+1)-core will always be a subgraph of a k-core. This means that the larger k becomes, the smaller its k-core (i.e. its corresponding subgraph) will be. The k-core value (or coreness) assigned to a vertex will correspond to the core with the greatest degree from all the cores where it belongs. This implementation of k-core will look for cores lying within the interval set by the min_core and max_core input variables.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- K-Core can be used to analyze hierarchical structures in a graph by revealing subgraphs with particular properties. It can also help to visualize large graphs in 2D by using the "layers" provided by the k-cores.
- Parameters:
graph
- the graph.minCore
- minimum k-core value.maxCore
- maximum k-core value.maxKCore
- Scalar (long) for holding the value of the maximum k-core found by the algorithm.kcore
- (out argument) vertex property with the largest k-core value for each vertex.- Returns:
- Pair holding the maximum core found and a node property with the largest k-core value for each node.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Long> prop = graph.createVertexProperty(PropertyType.LONG); PgxFuture<Pair<Scalar<Long>, VertexProperty<Integer, Long>>> promise = analyst.kcoreAsync( graph, 0, 2147483647, prop); promise.thenCompose(kcore -> { kcore.getFirst().get(); graph.queryPgqlAsync( "SELECT x, x." + kcore.getSecond().getName() + " MATCH (x) ORDER BY x." + kcore.getSecond().getName() + " DESC")) .thenAccept(PgqlResultSet::print); });
- See Also:
- An O(m) Algorithm for Cores Decomposition of Networks, k-core decomposition: a tool for the visualization of large scale networks
- Time:
-
kcoreAsync
public <ID> PgxFuture<Pair<Scalar<java.lang.Long>,VertexProperty<ID,java.lang.Long>>> kcoreAsync(PgxGraph graph, int minCore, int maxCore)
k-core decomposes a graph into layers revealing subgraphs with particular properties
Definition
A k-core is a maximal subgraph in which all of its vertices are connected and have the property that all of them have a degree of at least k. The k-cores can be regarded as layers in a graph, since a (k+1)-core will always be a subgraph of a k-core. This means that the larger k becomes, the smaller its k-core (i.e. its corresponding subgraph) will be. The k-core value (or coreness) assigned to a vertex will correspond to the core with the greatest degree from all the cores where it belongs. This implementation of k-core will look for cores lying within the interval set by the min_core and max_core input variables.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- K-Core can be used to analyze hierarchical structures in a graph by revealing subgraphs with particular properties. It can also help to visualize large graphs in 2D by using the "layers" provided by the k-cores.
- Parameters:
graph
- the graph.minCore
- minimum k-core value.maxCore
- maximum k-core value.- Returns:
- Pair holding the maximum core found and a node property with the largest k-core value for each node.
Examples
PgxGraph graph = ...; PgxFuture<Pair<Scalar<Long>, VertexProperty<Integer, Long>>> promise = analyst.kcoreAsync(graph, 0, 2147483647); promise.thenCompose(kcore -> { kcore.getFirst().get(); graph.queryPgqlAsync( "SELECT x, x." + kcore.getSecond().getName() + " MATCH (x) ORDER BY x." + kcore.getSecond().getName() + " DESC")) .thenAccept(PgqlResultSet::print); });
- See Also:
- An O(m) Algorithm for Cores Decomposition of Networks, k-core decomposition: a tool for the visualization of large scale networks
- Time:
-
kcoreAsync
public <ID> PgxFuture<Pair<Scalar<java.lang.Long>,VertexProperty<ID,java.lang.Long>>> kcoreAsync(PgxGraph graph, Scalar<java.lang.Long> maxKCore, VertexProperty<ID,java.lang.Long> kcore)
k-core decomposes a graph into layers revealing subgraphs with particular properties
Definition
A k-core is a maximal subgraph in which all of its vertices are connected and have the property that all of them have a degree of at least k. The k-cores can be regarded as layers in a graph, since a (k+1)-core will always be a subgraph of a k-core. This means that the larger k becomes, the smaller its k-core (i.e. its corresponding subgraph) will be. The k-core value (or coreness) assigned to a vertex will correspond to the core with the greatest degree from all the cores where it belongs. This implementation of k-core will look for cores lying within the interval set by the min_core and max_core input variables.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- K-Core can be used to analyze hierarchical structures in a graph by revealing subgraphs with particular properties. It can also help to visualize large graphs in 2D by using the "layers" provided by the k-cores.
- Parameters:
graph
- the graph.maxKCore
- Scalar (long) for holding the value of the maximum k-core found by the algorithm.kcore
- (out argument) vertex property with the largest k-core value for each vertex.- Returns:
- Pair holding the maximum core found and a node property with the largest k-core value for each node.
Examples
PgxGraph graph = ...; Scalar<Long> scalar = graph.createScalar(PropertyType.LONG); VertexProperty<Integer, Long> prop = graph.createVertexProperty(PropertyType.LONG); PgxFuture<Pair<Scalar<Long>, VertexProperty<Integer, Long>>> promise = analyst.kcoreAsync( graph, 0, 2147483647, prop); promise.thenCompose(kcore -> { kcore.getFirst().get(); graph.queryPgqlAsync( "SELECT x, x." + kcore.getSecond().getName() + " MATCH (x) ORDER BY x." + kcore.getSecond().getName() + " DESC")) .thenAccept(PgqlResultSet::print); });
- See Also:
- An O(m) Algorithm for Cores Decomposition of Networks, k-core decomposition: a tool for the visualization of large scale networks
- Time:
-
diameterAsync
public <ID> PgxFuture<Pair<Scalar<java.lang.Integer>,VertexProperty<ID,java.lang.Integer>>> diameterAsync(PgxGraph graph)
Diameter/radius gives an overview of the distances in a graph
Definition
The diameter of a graph is the maximal value of eccentricity of all the vertices in the graph, while the radius is the minimum graph eccentricity. The eccentricity of a vertex is the maximum distance via shortest paths to any other vertex in the graph. This algorithm will compute the eccentricity of all the vertices and will also return the diameter or radius value depending on the request. The algorithm will return an INF eccentricity and diameter/radius, for graphs with more than one strongly connected component.
Implementation Details
The implementation of this algorithm uses a parallel BFS method called Multi-Source BFS (MS-BSF) for a faster and more efficient search of the shortest paths. It still is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
- diameterOn: true
Applications
- This algorithm computes a basic structural graph property that is useful when looking for distances in a graph.
- Parameters:
graph
- the graph.- Returns:
- Pair holding the diameter of the graph and a node property with eccentricity value for each node.
Examples
PgxGraph graph = ...; PgxFuture<Pair<Scalar<Integer>, VertexProperty<Integer, Integer>>> promise = analyst.diameterAsync(graph); promise.thenCompose(diameter -> { diameter.getFirst().get(); graph.queryPgqlAsync( "SELECT x, x." + diameter.getSecond().getName() + " MATCH (x) ORDER BY x." + diameter.getSecond().getName() + " DESC")) .thenAccept(PgqlResultSet::print); });
- Time:
-
diameterAsync
public <ID> PgxFuture<Pair<Scalar<java.lang.Integer>,VertexProperty<ID,java.lang.Integer>>> diameterAsync(PgxGraph graph, Scalar<java.lang.Integer> diameter, VertexProperty<ID,java.lang.Integer> eccentricity)
Diameter/radius gives an overview of the distances in a graph
Definition
The diameter of a graph is the maximal value of eccentricity of all the vertices in the graph, while the radius is the minimum graph eccentricity. The eccentricity of a vertex is the maximum distance via shortest paths to any other vertex in the graph. This algorithm will compute the eccentricity of all the vertices and will also return the diameter or radius value depending on the request. The algorithm will return an INF eccentricity and diameter/radius, for graphs with more than one strongly connected component.
Implementation Details
The implementation of this algorithm uses a parallel BFS method called Multi-Source BFS (MS-BSF) for a faster and more efficient search of the shortest paths. It still is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
- diameterOn: true
Applications
- This algorithm computes a basic structural graph property that is useful when looking for distances in a graph.
- Parameters:
graph
- the graph.diameter
- Scalar (integer) for holding the value of the diameter of the graph.eccentricity
- (out argument) vertex property holding the eccentricity value for each vertex.- Returns:
- Pair holding the diameter of the graph and a node property with eccentricity value for each node.
Examples
PgxGraph graph = ...; Scalar<Integer> scalar = graph.createScalar(PropertyType.INTEGER); VertexProperty<Integer, Integer> prop = graph.createVertexProperty(PropertyType.INTEGER); PgxFuture<Pair<Scalar<Integer>, VertexProperty<Integer, Integer>>> promise = analyst.diameterAsync( graph, scalar, prop); promise.thenCompose(diameter -> { diameter.getFirst().get(); graph.queryPgqlAsync( "SELECT x, x." + diameter.getSecond().getName() + " MATCH (x) ORDER BY x." + diameter.getSecond().getName() + " DESC")) .thenAccept(PgqlResultSet::print); });
- Time:
-
radiusAsync
public <ID> PgxFuture<Pair<Scalar<java.lang.Integer>,VertexProperty<ID,java.lang.Integer>>> radiusAsync(PgxGraph graph)
Diameter/radius gives an overview of the distances in a graph
Definition
The diameter of a graph is the maximal value of eccentricity of all the vertices in the graph, while the radius is the minimum graph eccentricity. The eccentricity of a vertex is the maximum distance via shortest paths to any other vertex in the graph. This algorithm will compute the eccentricity of all the vertices and will also return the diameter or radius value depending on the request. The algorithm will return an INF eccentricity and diameter/radius, for graphs with more than one strongly connected component.
Implementation Details
The implementation of this algorithm uses a parallel BFS method called Multi-Source BFS (MS-BSF) for a faster and more efficient search of the shortest paths. It still is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
- diameterOn: true
Applications
- This algorithm computes a basic structural graph property that is useful when looking for distances in a graph.
- Parameters:
graph
- the graph.- Returns:
- Pair holding the radius of the graph and a node property with eccentricity value for each node.
Examples
PgxGraph graph = ...; PgxFuture<Pair<Scalar<Integer>, VertexProperty<Integer, Integer>>> promise = analyst.radiusAsync(graph); promise.thenCompose(radius -> { radius.getFirst().get(); graph.queryPgqlAsync( "SELECT x, x." + radius.getSecond().getName() + " MATCH (x) ORDER BY x." + radius.getSecond().getName() + " DESC")) .thenAccept(PgqlResultSet::print); });
- Time:
-
radiusAsync
public <ID> PgxFuture<Pair<Scalar<java.lang.Integer>,VertexProperty<ID,java.lang.Integer>>> radiusAsync(PgxGraph graph, Scalar<java.lang.Integer> radius, VertexProperty<ID,java.lang.Integer> eccentricity)
Diameter/radius gives an overview of the distances in a graph
Definition
The diameter of a graph is the maximal value of eccentricity of all the vertices in the graph, while the radius is the minimum graph eccentricity. The eccentricity of a vertex is the maximum distance via shortest paths to any other vertex in the graph. This algorithm will compute the eccentricity of all the vertices and will also return the diameter or radius value depending on the request. The algorithm will return an INF eccentricity and diameter/radius, for graphs with more than one strongly connected component.
Implementation Details
The implementation of this algorithm uses a parallel BFS method called Multi-Source BFS (MS-BSF) for a faster and more efficient search of the shortest paths. It still is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
- diameterOn: true
Applications
- This algorithm computes a basic structural graph property that is useful when looking for distances in a graph.
- Parameters:
graph
- the graph.radius
- Scalar (integer) for holding the value of the radius of the graph.eccentricity
- (out argument) vertex property holding the eccentricity value for each vertex.- Returns:
- Pair holding the radius of the graph and a node property with eccentricity value for each node.
Examples
PgxGraph graph = ...; Scalar<Integer> scalar = graph.createScalar(PropertyType.INTEGER); VertexProperty<Integer, Integer> prop = graph.createVertexProperty(PropertyType.INTEGER); PgxFuture<Pair<Scalar<Integer>, VertexProperty<Integer, Integer>>> promise = analyst.radiusAsync( graph, scalar, prop); promise.thenCompose(radius -> { radius.getFirst().get(); graph.queryPgqlAsync( "SELECT x, x." + radius.getSecond().getName() + " MATCH (x) ORDER BY x." + radius.getSecond().getName() + " DESC")) .thenAccept(PgqlResultSet::print); });
- Time:
-
peripheryAsync
public <ID> PgxFuture<VertexSet<ID>> peripheryAsync(PgxGraph graph)
Periphery/center gives an overview of the extreme distances and the corresponding vertices in a graph
Definition
The periphery of a graph is the set of vertices that have an eccentricity value equal to the diameter of the graph. Similarly, the center is comprised by the set of vertices with eccentricity equal to the radius of the graph. The diameter of a graph is the maximal value of eccentricity of all the vertices in the graph, while the radius is the minimum graph eccentricity. The eccentricity of a vertex is the maximum distance via shortest paths to any other vertex in the graph. This algorithm will return the set of vertices from the periphery or the center of the graph, depending on the request. The algorithm will return a set with all the vertices for graphs with more than one strongly connected component.
Implementation Details
The implementation of this algorithm uses a parallel BFS method called Multi-Source BFS (MS-BSF) for a faster and more efficient search of the shortests paths. It still is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- This algorithm computes a basic structural graph property that is useful when looking for distances in a graph.
- Parameters:
graph
- the graph.- Returns:
- vertex set holding the vertices from the periphery or center of the graph.
Examples
PgxGraph graph = ...; PgxFuture<VertexSet<Integer>> promise = analyst.peripheryAsync(graph); promise.thenAccept(periphery -> { ... });
- Time:
-
peripheryAsync
public <ID> PgxFuture<VertexSet<ID>> peripheryAsync(PgxGraph graph, VertexSet<ID> periphery)
Periphery/center gives an overview of the extreme distances and the corresponding vertices in a graph
Definition
The periphery of a graph is the set of vertices that have an eccentricity value equal to the diameter of the graph. Similarly, the center is comprised by the set of vertices with eccentricity equal to the radius of the graph. The diameter of a graph is the maximal value of eccentricity of all the vertices in the graph, while the radius is the minimum graph eccentricity. The eccentricity of a vertex is the maximum distance via shortest paths to any other vertex in the graph. This algorithm will return the set of vertices from the periphery or the center of the graph, depending on the request. The algorithm will return a set with all the vertices for graphs with more than one strongly connected component.
Implementation Details
The implementation of this algorithm uses a parallel BFS method called Multi-Source BFS (MS-BSF) for a faster and more efficient search of the shortests paths. It still is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- This algorithm computes a basic structural graph property that is useful when looking for distances in a graph.
- Parameters:
graph
- the graph.periphery
- (out argument) vertex set holding the vertices from the periphery or center of the graph.- Returns:
- vertex set holding the vertices from the periphery or center of the graph.
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.createVertexSet(); PgxFuture<VertexSet<Integer>> promise = analyst.peripheryAsync(graph, vertices); promise.thenAccept(periphery -> { ...; });
- Time:
-
centerAsync
public <ID> PgxFuture<VertexSet<ID>> centerAsync(PgxGraph graph)
Periphery/center gives an overview of the extreme distances and the corresponding vertices in a graph
Definition
The periphery of a graph is the set of vertices that have an eccentricity value equal to the diameter of the graph. Similarly, the center is comprised by the set of vertices with eccentricity equal to the radius of the graph. The diameter of a graph is the maximal value of eccentricity of all the vertices in the graph, while the radius is the minimum graph eccentricity. The eccentricity of a vertex is the maximum distance via shortest paths to any other vertex in the graph. This algorithm will return the set of vertices from the periphery or the center of the graph, depending on the request. The algorithm will return a set with all the vertices for graphs with more than one strongly connected component.
Implementation Details
The implementation of this algorithm uses a parallel BFS method called Multi-Source BFS (MS-BSF) for a faster and more efficient search of the shortests paths. It still is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- This algorithm computes a basic structural graph property that is useful when looking for distances in a graph.
- Parameters:
graph
- the graph.- Returns:
- vertex set holding the vertices from the periphery or center of the graph.
Examples
PgxGraph graph = ...; PgxFuture<VertexSet<Integer>> promise = analyst.centerAsync(graph); promise.thenAccept(center -> { ...; });
- Time:
-
centerAsync
public <ID> PgxFuture<VertexSet<ID>> centerAsync(PgxGraph graph, VertexSet<ID> center)
Periphery/center gives an overview of the extreme distances and the corresponding vertices in a graph
Definition
The periphery of a graph is the set of vertices that have an eccentricity value equal to the diameter of the graph. Similarly, the center is comprised by the set of vertices with eccentricity equal to the radius of the graph. The diameter of a graph is the maximal value of eccentricity of all the vertices in the graph, while the radius is the minimum graph eccentricity. The eccentricity of a vertex is the maximum distance via shortest paths to any other vertex in the graph. This algorithm will return the set of vertices from the periphery or the center of the graph, depending on the request. The algorithm will return a set with all the vertices for graphs with more than one strongly connected component.
Implementation Details
The implementation of this algorithm uses a parallel BFS method called Multi-Source BFS (MS-BSF) for a faster and more efficient search of the shortests paths. It still is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- This algorithm computes a basic structural graph property that is useful when looking for distances in a graph.
- Parameters:
graph
- the graph.center
- (out argument) vertex set holding the vertices from the periphery or center of the graph.- Returns:
- vertex set holding the vertices from the periphery or center of the graph.
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.createVertexSet(); PgxFuture<VertexSet<Integer>> promise = analyst.centerAsync(graph, vertices); promise.thenAccept(center -> { ...; });
- Time:
-
localClusteringCoefficientAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> localClusteringCoefficientAsync(PgxGraph graph)
LCC gives information about potential clustering options in a graph
Definition
The LCC of a vertex V is the fraction of connections between each pair of neighbors of V, i.e. the fraction of existing triangles from all the possible triangles involving V and every other pair of neighbor vertices of V. This implementation is intended for undirected graphs. Nodes with a degree smaller than 2 will be assigned a LCC value of 0.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V ^ 2) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- LCC can be used to determine how likely are vertices to cluster together, since it assess the degree of connections between a vertex and its neighbors. It could be used in social networks to spot out groups of people (communities), since people in groups tend to have a high density of links between them.
- Parameters:
graph
- the graph.- Returns:
- vertex property holding the lcc value for each vertex.
Examples
PgxGraph graph = ...; PgxFuture<VertexProperty<Integer, Double>> promise = analyst.localClusteringCoefficientAsync(graph); promise.thenCompose(lcc -> graph.queryPgqlAsync( "SELECT x, x." + lcc.getName() + " MATCH (x) ORDER BY x." + lcc.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- Approximating Clustering Coefficient and Transitivity, Clustering Coefficient
- Time:
-
localClusteringCoefficientAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> localClusteringCoefficientAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> lcc)
LCC gives information about potential clustering options in a graph
Definition
The LCC of a vertex V is the fraction of connections between each pair of neighbors of V, i.e. the fraction of existing triangles from all the possible triangles involving V and every other pair of neighbor vertices of V. This implementation is intended for undirected graphs. Nodes with a degree smaller than 2 will be assigned a LCC value of 0.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V ^ 2) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- LCC can be used to determine how likely are vertices to cluster together, since it assess the degree of connections between a vertex and its neighbors. It could be used in social networks to spot out groups of people (communities), since people in groups tend to have a high density of links between them.
- Parameters:
graph
- the graph.lcc
- (out argument)- Returns:
- vertex property holding the lcc value for each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> lcc = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.localClusteringCoefficientAsync(graph, lcc); promise.thenCompose(lcc -> graph.queryPgqlAsync( "SELECT x, x." + lcc.getName() + " MATCH (x) ORDER BY x." + lcc.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- Approximating Clustering Coefficient and Transitivity, Clustering Coefficient
- Time:
-
localClusteringCoefficientAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> localClusteringCoefficientAsync(PgxGraph graph, boolean ignoreEdgeDirection)
LCC gives information about potential clustering options in a graph
Definition
The LCC of a vertex V is the fraction of connections between each pair of neighbors of V, i.e. the fraction of existing triangles from all the possible triangles involving V and every other pair of neighbor vertices of V. This implementation is intended for undirected graphs. Nodes with a degree smaller than 2 will be assigned a LCC value of 0.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V ^ 2) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- LCC can be used to determine how likely are vertices to cluster together, since it assess the degree of connections between a vertex and its neighbors. It could be used in social networks to spot out groups of people (communities), since people in groups tend to have a high density of links between them.
- Parameters:
graph
- the graph.ignoreEdgeDirection
- boolean flag for ignoring the direction of the edges during the search.- Returns:
- vertex property holding the lcc value for each vertex.
Examples
PgxGraph graph = ...; PgxFuture<VertexProperty<Integer, Double>> promise = analyst.localClusteringCoefficientAsync(graph); promise.thenCompose(lcc -> graph.queryPgqlAsync( "SELECT x, x." + lcc.getName() + " MATCH (x) ORDER BY x." + lcc.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- Approximating Clustering Coefficient and Transitivity, Clustering Coefficient
- Time:
-
localClusteringCoefficientAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Double>> localClusteringCoefficientAsync(PgxGraph graph, VertexProperty<ID,java.lang.Double> lcc, boolean ignoreEdgeDirection)
LCC gives information about potential clustering options in a graph
Definition
The LCC of a vertex V is the fraction of connections between each pair of neighbors of V, i.e. the fraction of existing triangles from all the possible triangles involving V and every other pair of neighbor vertices of V. This implementation is intended for directed graphs and interprets them as undirected. Nodes with a degree smaller than 2 will be assigned a LCC value of 0.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V ^ 2) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- LCC can be used to determine how likely are vertices to cluster together, since it assess the degree of connections between a vertex and its neighbors. It could be used in social networks to spot out groups of people (communities), since people in groups tend to have a high density of links between them.
- Parameters:
graph
- the graph.lcc
- (out argument)ignoreEdgeDirection
- boolean flag for ignoring the direction of the edges during the search.- Returns:
- vertex property holding the lcc value for each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> lcc = graph.createVertexProperty(PropertyType.DOUBLE); PgxFuture<VertexProperty<Integer, Double>> promise = analyst.localClusteringCoefficientAsync(graph, lcc); promise.thenCompose(lcc -> graph.queryPgqlAsync( "SELECT x, x." + lcc.getName() + " MATCH (x) ORDER BY x." + lcc.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- Approximating Clustering Coefficient and Transitivity, Clustering Coefficient
- Time:
-
findCycleAsync
public <ID> PgxFuture<PgxPath<ID>> findCycleAsync(PgxGraph graph)
Find cycle looks for any loop in the graph.
Definition
This algorithm tries to find a cycle in a directed graph using DFS traversals and will return the first cycle found, if there is one. In such case, the vertices and edges involved in the cycle will be returned in the order of visit. The algorithm is expensive because it will perform DFS traversals using different vertices as starting points until it explores the whole graph (worst-case scenario), or until it finds a cycle.
Implementation Details
The implementation of this algorithm uses a built-in DFS feature. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * (V + E)) with V = number of vertices, E = number of edges
- Space:
O(5 * V + E) with V = number of vertices, E = number of edges
Default Values
Applications
- Cycles in a graph can be useful in problems related to routes and flows.
- Parameters:
graph
- the graph.- Returns:
- PgxPath representing the cycle as path, if exists.
Examples
PgxGraph graph = ...; PgxFuture<PgxPath<Integer>> promise = analyst.findCycleAsync(graph); promise.thenAccept(path -> { path.getPathLengthWithCost(); });
- Time:
-
findCycleAsync
public <ID> PgxFuture<PgxPath<ID>> findCycleAsync(PgxGraph graph, VertexSequence<ID> nodeSeq, EdgeSequence edgeSeq)
Find cycle looks for any loop in the graph.
Definition
This algorithm tries to find a cycle in a directed graph using DFS traversals and will return the first cycle found, if there is one. In such case, the vertices and edges involved in the cycle will be returned in the order of visit. The algorithm is expensive because it will perform DFS traversals using different vertices as starting points until it explores the whole graph (worst-case scenario), or until it finds a cycle.
Implementation Details
The implementation of this algorithm uses a built-in DFS feature. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * (V + E)) with V = number of vertices, E = number of edges
- Space:
O(5 * V + E) with V = number of vertices, E = number of edges
Default Values
Applications
- Cycles in a graph can be useful in problems related to routes and flows.
- Parameters:
graph
- the graph.nodeSeq
- (out argument) vertex sequence holding the vertices in the cycle.edgeSeq
- (out argument) edge sequence holding the edges in the cycle.- Returns:
- PgxPath representing the cycle as path, if exists.
Examples
PgxGraph graph = ...; VertexSequence<Integer> nodeSeq = graph.createVertexSequence(); EdgeSequence edgeSeq = graph.createEdgeSequence(); PgxFuture<PgxPath<Integer>> promise = analyst.findCycleAsync(graph, nodeSeq, edgeSeq); promise.thenAccept(path -> { path.getPathLengthWithCost(); });
- Time:
-
findCycleAsync
public <ID> PgxFuture<PgxPath<ID>> findCycleAsync(PgxGraph graph, PgxVertex<ID> src)
Find cycle looks for any loop in the graph.
Definition
This implementation tries to find a cycle in a directed graph using the given vertex as starting point for the DFS traversal and will return the first cycle found, if there is one. In such case, the vertices and edges involved in the cycle will be returned in the order of visit. Restricting the DFS traversal to a single starting point means that some parts of the graph may not get explored.
Implementation Details
The implementation of this algorithm uses a built-in DFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(4 * V + E) with V = number of vertices, E = number of edges
Default Values
- s: 0
Applications
- Cycles in a graph can be useful in problems related to routes and flows.
- Parameters:
graph
- the graph.src
- source vertex for the search.- Returns:
- PgxPath representing the cycle as path, if exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); PgxFuture<PgxPath<Integer>> promise = analyst.findCycleAsync(graph, vertex); promise.thenAccept(path -> { path.getPathLengthWithCost(); });
- Time:
-
findCycleAsync
public <ID> PgxFuture<PgxPath<ID>> findCycleAsync(PgxGraph graph, PgxVertex<ID> src, VertexSequence<ID> nodeSeq, EdgeSequence edgeSeq)
Find cycle looks for any loop in the graph.
Definition
This implementation tries to find a cycle in a directed graph using the given vertex as starting point for the DFS traversal and will return the first cycle found, if there is one. In such case, the vertices and edges involved in the cycle will be returned in the order of visit. Restricting the DFS traversal to a single starting point means that some parts of the graph may not get explored.
Implementation Details
The implementation of this algorithm uses a built-in DFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(4 * V + E) with V = number of vertices, E = number of edges
Default Values
- s: 0
Applications
- Cycles in a graph can be useful in problems related to routes and flows.
- Parameters:
graph
- the graph.src
- source vertex for the search.nodeSeq
- (out argument) vertex sequence holding the vertices in the cycle.edgeSeq
- (out argument) edge sequence holding the edges in the cycle.- Returns:
- PgxPath representing the cycle as path, if exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexSequence<Integer> nodeSeq = graph.createVertexSequence(); EdgeSequence edgeSeq = graph.createEdgeSequence(); PgxFuture<PgxPath<Integer>> promise = analyst.findCycleAsync(graph, vertex, nodeSeq, edgeSeq); promise.thenAccept(path -> { path.getPathLengthWithCost(); });
- Time:
-
reachabilityAsync
public <ID> PgxFuture<java.lang.Integer> reachabilityAsync(PgxGraph graph, PgxVertex<ID> source, PgxVertex<ID> dest, int maxHops, boolean ignoreEdgeDirection)
Reachability is a fast way to check if two vertices are reachable from each other.
Definition
This algorithm tries to find if the destination vertex is reachable given the source vertex and the maximum hop distance set by the user. The search can be performed in a directed or undirected way. These options may lead to different hop distances, since an undirected search has less restrictions on the possible paths connecting vertices than the directed option. Hence hop distances from an undirected search can be smaller than the ones from the directed cases.
Implementation Details
The implementation of this algorithm uses a built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(1)
Default Values
Applications
- Check connectivity between vertices in a graph.
- Parameters:
graph
- the graph.source
- source vertex for the search.dest
- destination vertex for the search.maxHops
- maximum hop distance between the source and destination vertices.ignoreEdgeDirection
- boolean flag for ignoring the direction of the edges during the search.- Returns:
- the number of hops between the vertices. It will return -1 if the vertices are not connected or are not reachable given the condition of the maximum hop distance allowed.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); PgxFuture<Integer> promise = analyst.reachabilityAsync(graph, src, dst, 2, false); promise.thenAccept(result -> { ...; });
- Time:
-
topologicalSortAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Integer>> topologicalSortAsync(PgxGraph graph)
Topological sort gives an order of visit for vertices in directed acyclic graphs
Definition
Topological sort tries to set an order over the vertices in a graph using the direction of the edges. A directed graph has a topological order if and only if it has no cycles, i.e. it is a directed acyclic graph. The algorithm visits the vertices in a DFS-like fashion to set up their order. The order of the vertices is returned as a vertex property, and the values will be set to -1 if there is a cycle in the graph.
Implementation Details
The implementation of this algorithm is sequential due the ordering constraint.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- This algorithm computes a basic structural graph property that is useful for tasks involving serialization and dependencies.
- Parameters:
graph
- the graph.- Returns:
- vertex property holding the topological order of each vertex.
Examples
PgxGraph graph = ...; PgxFuture<VertexProperty<Integer, Integer>> promise = analyst.topologicalSortAsync(graph); promise.thenCompose(topoSort -> graph.queryPgqlAsync( "SELECT x, x." + topoSort.getName() + " WHERE (x) ORDER BY x." + topoSort.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
topologicalSortAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Integer>> topologicalSortAsync(PgxGraph graph, VertexProperty<ID,java.lang.Integer> topoSort)
Topological sort gives an order of visit for vertices in directed acyclic graphs
Definition
Topological sort tries to set an order over the vertices in a graph using the direction of the edges. A directed graph has a topological order if and only if it has no cycles, i.e. it is a directed acyclic graph. The algorithm visits the vertices in a DFS-like fashion to set up their order. The order of the vertices is returned as a vertex property, and the values will be set to -1 if there is a cycle in the graph.
Implementation Details
The implementation of this algorithm is sequential due the ordering constraint.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- This algorithm computes a basic structural graph property that is useful for tasks involving serialization and dependencies.
- Parameters:
graph
- the graph.topoSort
- (out argument) vertex property holding the topological order of each vertex.- Returns:
- vertex property holding the topological order of each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Integer> topoSort = graph.createVertexProperty(PropertyType.INTEGER); PgxFuture<VertexProperty<Integer, Integer>> promise = analyst.topologicalSortAsync(graph, topoSort); promise.thenCompose(topoSort -> graph.queryPgqlAsync( "SELECT x, x." + topoSort.getName() + " WHERE (x) ORDER BY x." + topoSort.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
topologicalScheduleAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Integer>> topologicalScheduleAsync(PgxGraph graph, VertexSet<ID> source)
Topological schedule gives an order of visit for the reachable vertices from the source
Definition
Topological schedule sets an order over the vertices in a graph based on the proximity these have to the vertices from the given source. The algorithm does a BFS traversal for each vertex from the source set in order to assign the correct scheduling order to all the reachable, even if the graph is undirected or has cycles. The vertices that are not reachable will be assigned a value of -1.
Implementation Details
The implementation of this algorithm uses a built-in BFS feature.
Complexity
- Time:
O(k * (V + E)) with V = number of vertices, E = number of edges, k = size of the source set
- Space:
O(V) with V = number of vertices
Default Values
Applications
- This algorithm computes a basic structural graph property that is useful for tasks involving serialization and dependencies.
- Parameters:
graph
- the graph.source
- set of vertices to be used as the starting points for the scheduling order.- Returns:
- vertex property holding the scheduled order of each vertex.
Examples
PgxGraph graph = ...; VertexSet<Integer> source = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); PgxFuture<VertexProperty<Integer, Integer>> promise = analyst.topologicalScheduleAsync(graph, source); promise.thenCompose(topoSched -> graph.queryPgqlAsync( "SELECT x, x." + topoSched.getName() + " WHERE (x) ORDER BY x." + topoSched.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
topologicalScheduleAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Integer>> topologicalScheduleAsync(PgxGraph graph, VertexSet<ID> source, VertexProperty<ID,java.lang.Integer> topoSched)
Topological schedule gives an order of visit for the reachable vertices from the source
Definition
Topological schedule sets an order over the vertices in a graph based on the proximity these have to the vertices from the given source. The algorithm does a BFS traversal for each vertex from the source set in order to assign the correct scheduling order to all the reachable, even if the graph is undirected or has cycles. The vertices that are not reachable will be assigned a value of -1.
Implementation Details
The implementation of this algorithm uses a built-in BFS feature.
Complexity
- Time:
O(k * (V + E)) with V = number of vertices, E = number of edges, k = size of the source set
- Space:
O(V) with V = number of vertices
Default Values
Applications
- This algorithm computes a basic structural graph property that is useful for tasks involving serialization and dependencies.
- Parameters:
graph
- the graph.source
- set of vertices to be used as the starting points for the scheduling order.topoSched
- (out argument) vertex property holding the scheduled order of each vertex.- Returns:
- vertex property holding the scheduled order of each vertex.
Examples
PgxGraph graph = ...; VertexSet<Integer> source = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); VertexProperty<Integer, Integer> topoSched = graph.createVertexProperty(PropertyType.INTEGER); PgxFuture<VertexProperty<Integer, Integer>> promise = analyst.topologicalScheduleAsync(graph, source, topoSched); promise.thenCompose(topoSched -> graph.queryPgqlAsync( "SELECT x, x." + topoSched.getName() + " WHERE (x) ORDER BY x." + topoSched.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
outDegreeDistributionAsync
public PgxFuture<PgxMap<java.lang.Integer,java.lang.Long>> outDegreeDistributionAsync(PgxGraph graph)
Out-degree distribution gives information about the outgoing flows in a graph
Definition
This version of the degree distribution will return a map with the distribution of the out-degree (i.e. just outgoing edges) of the graph. For undirected graphs the algorithm will consider all the edges (incoming and outgoing) for the distribution.
Implementation Details
This algorithm runs in a sequential way. It uses a map with type int for the keys and type long for storing the mapped values of the distribution, like a histogram.
Complexity
- Time:
O(V) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Degree distribution is a basic structural property of a graph which can help to characterize and classify them.
- Parameters:
graph
- the graph.- Returns:
- map holding a histogram of the node degrees in the graph.
Examples
PgxGraph graph = ...; PgxFuture<PgxMap<Integer, Long>> promise = analyst.outDegreeDistributionAsync(graph); promise.thenAccept(map -> { ...; });
- Time:
-
outDegreeDistributionAsync
public PgxFuture<PgxMap<java.lang.Integer,java.lang.Long>> outDegreeDistributionAsync(PgxGraph graph, PgxMap<java.lang.Integer,java.lang.Long> distribution)
Out-degree distribution gives information about the outgoing flows in a graph
Definition
This version of the degree distribution will return a map with the distribution of the out-degree (i.e. just outgoing edges) of the graph. For undirected graphs the algorithm will consider all the edges (incoming and outgoing) for the distribution.
Implementation Details
This algorithm runs in a sequential way. It uses a map with type int for the keys and type long for storing the mapped values of the distribution, like a histogram.
Complexity
- Time:
O(V) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Degree distribution is a basic structural property of a graph which can help to characterize and classify them.
- Parameters:
graph
- the graph.distribution
- (out argument)- Returns:
- map holding a histogram of the node degrees in the graph.
Examples
PgxGraph graph = ...; PgxMap<Integer, Long> distribution = graph.createMap(PropertyType.INTEGER, PropertyType.LONG); PgxFuture<PgxMap<Integer, Long>> promise = analyst.outDegreeDistributionAsync(graph, distribution); promise.thenAccept(map -> { ...; });
- Time:
-
inDegreeDistributionAsync
public PgxFuture<PgxMap<java.lang.Integer,java.lang.Long>> inDegreeDistributionAsync(PgxGraph graph)
In-degree distribution gives information about the incoming flows in a graph
Definition
This version of the degree distribution will return a map with the distribution of the in-degree (i.e. just incoming edges) of the graph. For undirected graphs the algorithm will consider all the edges (incoming and outgoing) for the distribution.
Implementation Details
This algorithm runs in a sequential way. It uses a map with type int for the keys and type long for storing the mapped values of the distribution, like a histogram.
Complexity
- Time:
O(V) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Degree distribution is a basic structural property of a graph which can help to characterize and classify them.
- Parameters:
graph
- the graph.- Returns:
- map holding a histogram of the vertex degrees in the graph.
Examples
PgxGraph graph = ...; PgxFuture<PgxMap<Integer, Long>> promise = analyst.inDegreeDistributionAsync(graph); promise.thenAccept(map -> { ...; });
- Time:
-
inDegreeDistributionAsync
public PgxFuture<PgxMap<java.lang.Integer,java.lang.Long>> inDegreeDistributionAsync(PgxGraph graph, PgxMap<java.lang.Integer,java.lang.Long> distribution)
In-degree distribution gives information about the incoming flows in a graph
Definition
This version of the degree distribution will return a map with the distribution of the in-degree (i.e. just incoming edges) of the graph. For undirected graphs the algorithm will consider all the edges (incoming and outgoing) for the distribution.
Implementation Details
This algorithm runs in a sequential way. It uses a map with type int for the keys and type long for storing the mapped values of the distribution, like a histogram.
Complexity
- Time:
O(V) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Degree distribution is a basic structural property of a graph which can help to characterize and classify them.
- Parameters:
graph
- the graph.distribution
- (out argument)- Returns:
- map holding a histogram of the vertex degrees in the graph.
Examples
PgxGraph graph = ...; PgxMap<Integer, Long> distribution = graph.createMap(PropertyType.INTEGER, PropertyType.LONG); PgxFuture<PgxMap<Integer, Long>> promise = analyst.inDegreeDistributionAsync(graph, distribution); promise.thenAccept(map -> { ...; });
- Time:
-
primAsync
public PgxFuture<EdgeProperty<java.lang.Boolean>> primAsync(PgxGraph graph, EdgeProperty<java.lang.Double> weight)
prim reveals tree structures with shortest paths in a graph
Definition
This implementation of Prim's algorithm works on undirected graphs that are connected and have no multi-edges (i.e. more than one edge connecting the same pair of vertices). The algorithm computes the minimum spanning tree (MST) of the graph using the weights associated to each edge. A minimum spanning tree is a subset of the edges that connects all the vertices in the graph such that it minimizes the total weight associated to the edges.
Implementation Details
The implementation of this algorithm uses an iterative method.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(2 * E + V) with V = number of vertices, E = number of edges
Default Values
Applications
- The trees found with Prim's algorithm can be used to simplify the design of networks when just looking to connect all the elements on the network, like in computer or transportation networks. It can also be used to generate mazes using the structure of a graph.
- Parameters:
graph
- the graph.weight
- edge property holding the weight of each edge in the graph.- Returns:
- edge property holding the edges belonging to the minimum spanning tree of the graph (i.e. all the edges with in_mst=true).
Examples
PgxGraph graph = ...; EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxFuture<EdgeProperty<Boolean>> promise = analyst.primAsync(graph, cost); promise.thenCompose(prim -> graph.queryPgqlAsync( "SELECT x, x." + prim.getName() + " MATCH (x) ORDER BY x." + prim.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
primAsync
public PgxFuture<EdgeProperty<java.lang.Boolean>> primAsync(PgxGraph graph, EdgeProperty<java.lang.Double> weight, EdgeProperty<java.lang.Boolean> mst)
prim reveals tree structures with shortest paths in a graph
Definition
This implementation of Prim's algorithm works on undirected graphs that are connected and have no multi-edges (i.e. more than one edge connecting the same pair of vertices). The algorithm computes the minimum spanning tree (MST) of the graph using the weights associated to each edge. A minimum spanning tree is a subset of the edges that connects all the vertices in the graph such that it minimizes the total weight associated to the edges.
Implementation Details
The implementation of this algorithm uses an iterative method.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(2 * E + V) with V = number of vertices, E = number of edges
Default Values
Applications
- The trees found with Prim's algorithm can be used to simplify the design of networks when just looking to connect all the elements on the network, like in computer or transportation networks. It can also be used to generate mazes using the structure of a graph.
- Parameters:
graph
- the graph.weight
- edge property holding the weight of each edge in the graph.mst
- (out argument) edge property holding the edges belonging to the minimum spanning tree of the graph (i.e. all the edges with in_mst=true).- Returns:
- edge property holding the edges belonging to the minimum spanning tree of the graph (i.e. all the edges with in_mst=true).
Examples
PgxGraph graph = ...; EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); EdgeProperty<Boolean> mst = graph.createEdgeProperty(PropertyType.BOOLEAN); PgxFuture<EdgeProperty<Boolean>> promise = analyst.primAsync(graph, cost, mst); promise.thenCompose(prim -> graph.queryPgqlAsync( "SELECT x, x." + prim.getName() + " MATCH (x) ORDER BY x." + prim.getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Time:
-
filteredBfsAsync
public <ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>> filteredBfsAsync(PgxGraph graph, PgxVertex<ID> root)
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the BFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using BFS.
- You can use BFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); PgxFuture<Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>>> promise = analyst.filteredBfsAsync(graph, vertex); promise.thenCompose(bfs -> graph.queryPgqlAsync( "SELECT x, x." + bfs.getFirst().getName() + ", x." + bfs.getSecond().getName() + " MATCH (x) ORDER BY x." + bfs.getFirst().getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- Breadth-first search
- Time:
-
filteredBfsAsync
public <ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>> filteredBfsAsync(PgxGraph graph, PgxVertex<ID> root, int maxDepth)
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the BFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using BFS.
- You can use BFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.maxDepth
- maximum depth limit for the BFS traversal.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); PgxFuture<Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>>> promise = analyst.filteredBfsAsync(graph, vertex, 2); promise.thenCompose(bfs -> graph.queryPgqlAsync( "SELECT x, x." + bfs.getFirst().getName() + ", x." + bfs.getSecond().getName() + " MATCH (x) ORDER BY x." + bfs.getFirst().getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- Breadth-first search
- Time:
-
filteredBfsAsync
public <ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>> filteredBfsAsync(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator)
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the BFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using BFS.
- You can use BFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.navigator
- navigator expression to be evaluated on the vertices during the graph traversal.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexFilter navigator = VertexFilter.ALL; PgxFuture<Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>>> promise = analyst.filteredBfsAsync(graph, vertex, navigator); promise.thenCompose(bfs -> graph.queryPgqlAsync( "SELECT x, x." + bfs.getFirst().getName() + ", x." + bfs.getSecond().getName() + " MATCH (x) ORDER BY x." + bfs.getFirst().getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Since:
- 20.1.0
- See Also:
- Breadth-first search
- Time:
-
filteredBfsAsync
public <ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>> filteredBfsAsync(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, int maxDepth)
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the BFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using BFS.
- You can use BFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.navigator
- navigator expression to be evaluated on the vertices during the graph traversal.maxDepth
- maximum depth limit for the BFS traversal.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexFilter navigator = VertexFilter.ALL; PgxFuture<Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>>> promise = analyst.filteredBfsAsync(graph, vertex, navigator, 2); promise.thenCompose(bfs -> graph.queryPgqlAsync( "SELECT x, x." + bfs.getFirst().getName() + ", x." + bfs.getSecond().getName() + " MATCH (x) ORDER BY x." + bfs.getFirst().getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Since:
- 20.1.0
- See Also:
- Breadth-first search
- Time:
-
filteredBfsAsync
public <ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>> filteredBfsAsync(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf)
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the BFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using BFS.
- You can use BFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.navigator
- navigator expression to be evaluated on the vertices during the graph traversal.initWithInf
- boolean flag to set the initial distance values of the vertices. If set to true, it will initialize the distances as INF, and -1 otherwise.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexFilter navigator = VertexFilter.ALL; PgxFuture<Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>>> promise = analyst.filteredBfsAsync(graph, vertex, filter, navigator, true); promise.thenCompose(bfs -> graph.queryPgqlAsync( "SELECT x, x." + bfs.getFirst().getName() + ", x." + bfs.getSecond().getName() + " MATCH (x) ORDER BY x." + bfs.getFirst().getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Since:
- 20.1.0
- See Also:
- Breadth-first search
- Time:
-
filteredBfsAsync
public <ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>> filteredBfsAsync(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf, int maxDepth)
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the BFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using BFS.
- You can use BFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.navigator
- navigator expression to be evaluated on the vertices during the graph traversal.initWithInf
- boolean flag to set the initial distance values of the vertices. If set to true, it will initialize the distances as INF, and -1 otherwise.maxDepth
- maximum depth limit for the BFS traversal.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexFilter navigator = VertexFilter.ALL; PgxFuture<Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>>> promise = analyst.filteredBfsAsync(graph, vertex, navigator, true, 2); promise.thenCompose(bfs -> graph.queryPgqlAsync( "SELECT x, x." + bfs.getFirst().getName() + ", x." + bfs.getSecond().getName() + " MATCH (x) ORDER BY x." + bfs.getFirst().getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Since:
- 20.1.0
- See Also:
- Breadth-first search
- Time:
-
filteredBfsAsync
public <ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>> filteredBfsAsync(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf, VertexProperty<ID,java.lang.Integer> distance, VertexProperty<ID,PgxVertex<ID>> parent)
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the BFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using BFS.
- You can use BFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.navigator
- navigator expression to be evaluated on the vertices during the graph traversal.initWithInf
- boolean flag to set the initial distance values of the vertices. If set to true, it will initialize the distances as INF, and -1 otherwise.distance
- (out argument) vertex property holding the hop distance for each reachable vertex in the graph.parent
- (out argument) vertex property holding the parent vertex of the each reachable vertex in the path.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexFilter navigator = VertexFilter.ALL; VertexProperty<Integer, Integer> distance = graph.createVertexProperty(PropertyType.INTEGER); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); PgxFuture<Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>>> promise = analyst.filteredBfsAsync(graph, vertex, navigator, true, distance, parent); promise.thenCompose(bfs -> graph.queryPgqlAsync( "SELECT x, x." + bfs.getFirst().getName() + ", x." + bfs.getSecond().getName() + " MATCH (x) ORDER BY x." + bfs.getFirst().getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Since:
- 20.1.0
- See Also:
- Breadth-first search
- Time:
-
filteredBfsAsync
public <ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>> filteredBfsAsync(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf, int maxDepth, VertexProperty<ID,java.lang.Integer> distance, VertexProperty<ID,PgxVertex<ID>> parent)
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the BFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using BFS.
- You can use BFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.navigator
- navigator expression to be evaluated on the vertices during the graph traversal.initWithInf
- boolean flag to set the initial distance values of the vertices. If set to true, it will initialize the distances as INF, and -1 otherwise.maxDepth
- maximum depth limit for the BFS traversal.distance
- (out argument) vertex property holding the hop distance for each reachable vertex in the graph.parent
- (out argument) vertex property holding the parent vertex of the each reachable vertex in the path.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexFilter navigator = VertexFilter.ALL; VertexProperty<Integer, Integer> distance = graph.createVertexProperty(PropertyType.INTEGER); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); PgxFuture<Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>>> promise = analyst.filteredBfsAsync(graph, vertex, navigator, true, 2, distance, parent); promise.thenCompose(bfs -> graph.queryPgqlAsync( "SELECT x, x." + bfs.getFirst().getName() + ", x." + bfs.getSecond().getName() + " MATCH (x) ORDER BY x." + bfs.getFirst().getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Since:
- 20.1.0
- See Also:
- Breadth-first search
- Time:
-
filteredDfsAsync
public <ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>> filteredDfsAsync(PgxGraph graph, PgxVertex<ID> root)
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the DFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in DFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using DFS.
- You can use DFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); PgxFuture<Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>>> promise = analyst.filteredDfsAsync(graph, vertex); promise.thenCompose(dfs -> graph.queryPgqlAsync( "SELECT x, x." + dfs.getFirst().getName() + ", x." + dfs.getSecond().getName() + " MATCH (x) ORDER BY x." + dfs.getFirst().getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- Depth-first search
- Time:
-
filteredDfsAsync
public <ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>> filteredDfsAsync(PgxGraph graph, PgxVertex<ID> root, int maxDepth)
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the DFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in DFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using DFS.
- You can use DFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.maxDepth
- maximum depth limit for the BFS traversal.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); PgxFuture<Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>>> promise = analyst.filteredDfsAsync(graph, vertex, 2); promise.thenCompose(dfs -> graph.queryPgqlAsync( "SELECT x, x." + dfs.getFirst().getName() + ", x." + dfs.getSecond().getName() + " MATCH (x) ORDER BY x." + dfs.getFirst().getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- See Also:
- Depth-first search
- Time:
-
filteredDfsAsync
public <ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>> filteredDfsAsync(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator)
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the DFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in DFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using DFS.
- You can use DFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.navigator
- navigator expression to be evaluated on the vertices during the graph traversal.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexFilter navigator = VertexFilter.ALL; PgxFuture<Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>>> promise = analyst.filteredDfsAsync(graph, vertex, filter, navigator); promise.thenCompose(dfs -> graph.queryPgqlAsync( "SELECT x, x." + dfs.getFirst().getName() + ", x." + dfs.getSecond().getName() + " MATCH (x) ORDER BY x." + dfs.getFirst().getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Since:
- 20.1.0
- See Also:
- Depth-first search
- Time:
-
filteredDfsAsync
public <ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>> filteredDfsAsync(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, int maxDepth)
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the DFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in DFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using DFS.
- You can use DFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.navigator
- navigator expression to be evaluated on the vertices during the graph traversal.maxDepth
- maximum depth limit for the BFS traversal.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexFilter filter = VertexFilter.ALL; VertexFilter navigator = VertexFilter.ALL; PgxFuture<Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>>> promise = analyst.filteredDfsAsync(graph, vertex, filter, navigator, 2); promise.thenCompose(dfs -> graph.queryPgqlAsync( "SELECT x, x." + dfs.getFirst().getName() + ", x." + dfs.getSecond().getName() + " MATCH (x) ORDER BY x." + dfs.getFirst().getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Since:
- 20.1.0
- See Also:
- Depth-first search
- Time:
-
filteredDfsAsync
public <ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>> filteredDfsAsync(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf)
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the DFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in DFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using DFS.
- You can use DFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.navigator
- navigator expression to be evaluated on the vertices during the graph traversal.initWithInf
- boolean flag to set the initial distance values of the vertices. If set to true, it will initialize the distances as INF, and -1 otherwise.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexFilter navigator = VertexFilter.ALL; PgxFuture<Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>>> promise = analyst.filteredDfsAsync(graph, vertex, filter, navigator, true); promise.thenCompose(dfs -> graph.queryPgqlAsync( "SELECT x, x." + dfs.getFirst().getName() + ", x." + dfs.getSecond().getName() + " MATCH (x) ORDER BY x." + dfs.getFirst().getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Since:
- 20.1.0
- See Also:
- Depth-first search
- Time:
-
filteredDfsAsync
public <ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>> filteredDfsAsync(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf, int maxDepth)
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the DFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in DFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using DFS.
- You can use DFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.navigator
- navigator expression to be evaluated on the vertices during the graph traversal.initWithInf
- boolean flag to set the initial distance values of the vertices. If set to true, it will initialize the distances as INF, and -1 otherwise.maxDepth
- maximum depth limit for the BFS traversal.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexFilter navigator = VertexFilter.ALL; PgxFuture<Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>>> promise = analyst.filteredDfsAsync(graph, vertex, filter, navigator, true, 2); promise.thenCompose(dfs -> graph.queryPgqlAsync( "SELECT x, x." + dfs.getFirst().getName() + ", x." + dfs.getSecond().getName() + " MATCH (x) ORDER BY x." + dfs.getFirst().getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Since:
- 20.1.0
- See Also:
- Depth-first search
- Time:
-
filteredDfsAsync
public <ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>> filteredDfsAsync(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf, VertexProperty<ID,java.lang.Integer> distance, VertexProperty<ID,PgxVertex<ID>> parent)
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the DFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in DFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using DFS.
- You can use DFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.navigator
- navigator expression to be evaluated on the vertices during the graph traversal.initWithInf
- boolean flag to set the initial distance values of the vertices. If set to true, it will initialize the distances as INF, and -1 otherwise.distance
- (out argument) vertex property holding the hop distance for each reachable vertex in the graph.parent
- (out argument) vertex property holding the parent vertex of the each reachable vertex in the path.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexFilter navigator = VertexFilter.ALL; VertexProperty<Integer, Integer> distance = graph.createVertexProperty(PropertyType.INTEGER); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); PgxFuture<Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>>> promise = analyst.filteredDfsAsync(graph, vertex, filter, navigator, true, distance, parent); promise.thenCompose(dfs -> graph.queryPgqlAsync( "SELECT x, x." + dfs.getFirst().getName() + ", x." + dfs.getSecond().getName() + " MATCH (x) ORDER BY x." + dfs.getFirst().getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Since:
- 20.1.0
- See Also:
- Depth-first search
- Time:
-
filteredDfsAsync
public <ID> PgxFuture<Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>>> filteredDfsAsync(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf, int maxDepth, VertexProperty<ID,java.lang.Integer> distance, VertexProperty<ID,PgxVertex<ID>> parent)
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the DFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in DFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using DFS.
- You can use DFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.navigator
- navigator expression to be evaluated on the vertices during the graph traversal.initWithInf
- boolean flag to set the initial distance values of the vertices. If set to true, it will initialize the distances as INF, and -1 otherwise.maxDepth
- maximum depth limit for the BFS traversal.distance
- (out argument) vertex property holding the hop distance for each reachable vertex in the graph.parent
- (out argument) vertex property holding the parent vertex of the each reachable vertex in the path.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexFilter navigator = VertexFilter.ALL; VertexProperty<Integer, Integer> distance = graph.createVertexProperty(PropertyType.INTEGER); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); PgxFuture<Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>>> promise = analyst.filteredDfsAsync(graph, vertex, filter, navigator, true, 2, distance, parent); promise.thenCompose(dfs -> graph.queryPgqlAsync( "SELECT x, x." + dfs.getFirst().getName() + ", x." + dfs.getSecond().getName() + " MATCH (x) ORDER BY x." + dfs.getFirst().getName() + " DESC")) .thenAccept(PgqlResultSet::print);
- Since:
- 20.1.0
- See Also:
- Depth-first search
- Time:
-
computeHighDegreeVerticesAsync
public <ID> PgxFuture<Pair<PgxMap<java.lang.Integer,PgxVertex<ID>>,VertexSet<ID>>> computeHighDegreeVerticesAsync(PgxGraph graph, int k, PgxMap<java.lang.Integer,PgxVertex<ID>> highDegreeVertexMapping, VertexSet<ID> highDegreeVertices)
Computes the k vertices with the highest degrees in the graph.
Definition
Computes the k vertices with the highest degrees in the graph. The resulting map will contain a mapping with the sorted index to the high-degree vertex with the index.
Implementation Details
null
Complexity
- Time:
O(N log N) with N = number of vertices
- Space:
O(k) with V = number of vertices
Default Values
Applications
- Can be used to compute the vertices with the highest degrees a.k.a. super-vertices. This information can be useful in certain applications.
- Parameters:
graph
- the graph.k
- number of high-degree vertices to be computed.highDegreeVertexMapping
- (out-argument) the high-degree vertices.highDegreeVertices
- (out-argument) the high-degree vertices.- Returns:
- Pair holding first a map with the top
k
high-degree vertices and their indices and a second vertex set containing the same vertices.
- Time:
-
computeHighDegreeVerticesAsync
public <ID> PgxFuture<Pair<PgxMap<java.lang.Integer,PgxVertex<ID>>,VertexSet<ID>>> computeHighDegreeVerticesAsync(PgxGraph graph, int k)
Computes the k vertices with the highest degrees in the graph.
Definition
Computes the k vertices with the highest degrees in the graph. The resulting map will contain a mapping with the sorted index to the high-degree vertex with the index.
Implementation Details
null
Complexity
- Time:
O(N log N) with N = number of vertices
- Space:
O(k) with V = number of vertices
Default Values
Applications
- Can be used to compute the vertices with the highest degrees a.k.a. super-vertices. This information can be useful in certain applications.
- Parameters:
graph
- the graph.k
- number of high-degree vertices to be computed.- Returns:
- Pair holding first a map with the top
k
high-degree vertices and their indices and a second vertex set containing the same vertices.
- Time:
-
createDistanceIndexAsync
public <ID> PgxFuture<VertexProperty<ID,PgxVect<java.lang.Integer>>> createDistanceIndexAsync(PgxGraph graph, PgxMap<java.lang.Integer,PgxVertex<ID>> highDegreeVertexMapping, VertexSet<ID> highDegreeVertices)
Computes an index with distances to each high-degree vertex.
Definition
Computes an index which contains the distance to the given high-degree vertices for every node in the graph.
Implementation Details
null
Complexity
- Time:
O(E * k) with E = number of edges, k <= number of high-degree vertices
- Space:
O(V * k) with V = number of vertices
Default Values
Applications
- The index can be used to speed up certain path-finding algorithms.
- Parameters:
graph
- the graph.highDegreeVertexMapping
- map containing the high-degree vertices as values and indices from 0 to k as keys.highDegreeVertices
- a set containing the high-degree vertices.- Returns:
- A vertex-integer-vector property containing the distances from each high-degree vertex for each vertex in the graph.
- Time:
-
createDistanceIndexAsync
public <ID> PgxFuture<VertexProperty<ID,PgxVect<java.lang.Integer>>> createDistanceIndexAsync(PgxGraph graph, PgxMap<java.lang.Integer,PgxVertex<ID>> highDegreeVertexMapping, VertexSet<ID> highDegreeVertices, VertexProperty<ID,PgxVect<java.lang.Integer>> index)
Computes an index with distances to each high-degree vertex.
Definition
Computes an index which contains the distance to the given high-degree vertices for every node in the graph.
Implementation Details
null
Complexity
- Time:
O(E * k) with E = number of edges, k <= number of high-degree vertices
- Space:
O(V * k) with V = number of vertices
Default Values
Applications
- The index can be used to speed up certain path-finding algorithms.
- Parameters:
graph
- the graph.highDegreeVertexMapping
- map containing the high-degree vertices as values and indices from 0 to k as keys.highDegreeVertices
- a set containing the high-degree vertices.index
- (out-argument) the index containing the distances to each high-degree vertex for all vertices.- Returns:
- A vertex-integer-vector property containing the distances from each high-degree vertex for each vertex in the graph.
- Time:
-
limitedShortestPathHopDistAsync
public <ID> PgxFuture<Pair<VertexSequence<ID>,EdgeSequence>> limitedShortestPathHopDistAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, int maxHops, PgxMap<java.lang.Integer,PgxVertex<ID>> highDegreeVertexMapping, VertexSet<ID> highDegreeVertices, VertexProperty<ID,PgxVect<java.lang.Integer>> index, VertexSequence<ID> pathVertices, EdgeSequence pathEdges)
Computes the k-hop limited shortest path between two vertices.
Definition
Computes the shortest path between the source and destination vertex. The algorithm only considers paths up to a length of k.
Implementation Details
null
Complexity
- Time:
O(E) with E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Path-finding applications where the path should be / can be limited by a certain number of hops.
- Parameters:
graph
- the graph.src
- the source vertex.dst
- the destination vertex.maxHops
- the maximum number of edges to follow when trying to find a path.highDegreeVertexMapping
- the high-degree vertices.highDegreeVertices
- the high-degree vertices.index
- index containing distances to high-degree vertices.pathVertices
- (out-argument) will contain the vertices on the found path or will be empty if there is none.pathEdges
- (out-argument) will contain the vertices on the found path or will be empty if there is none.- Returns:
- A pair containing the vertices in the shortest path from
src
todst
and the edges on the path. Both will be empty if there is no path withinmaxHops
steps.
- Time:
-
limitedShortestPathHopDistAsync
public <ID> PgxFuture<Pair<VertexSequence<ID>,EdgeSequence>> limitedShortestPathHopDistAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, int maxHops, PgxMap<java.lang.Integer,PgxVertex<ID>> highDegreeVertexMapping, VertexSet<ID> highDegreeVertices, VertexProperty<ID,PgxVect<java.lang.Integer>> index)
Computes the k-hop limited shortest path between two vertices.
Definition
Computes the shortest path between the source and destination vertex. The algorithm only considers paths up to a length of k.
Implementation Details
null
Complexity
- Time:
O(E) with E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Path-finding applications where the path should be / can be limited by a certain number of hops.
- Parameters:
graph
- the graph.src
- the source vertex.dst
- the destination vertex.maxHops
- the maximum number of edges to follow when trying to find a path.highDegreeVertexMapping
- the high-degree vertices.highDegreeVertices
- the high-degree vertices.index
- index containing distances to high-degree vertices.- Returns:
- A pair containing the vertices in the shortest path from
src
todst
and the edges on the path. Both will be empty if there is no path withinmaxHops
steps.
- Time:
-
limitedShortestPathHopDistFilteredAsync
public <ID> PgxFuture<Pair<VertexSequence<ID>,EdgeSequence>> limitedShortestPathHopDistFilteredAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, int maxHops, PgxMap<java.lang.Integer,PgxVertex<ID>> highDegreeVertexMapping, VertexSet<ID> highDegreeVertices, VertexProperty<ID,PgxVect<java.lang.Integer>> index, EdgeFilter filter, VertexSequence<ID> pathVertices, EdgeSequence pathEdges)
Computes the k-hop limited shortest path between two vertices.
Definition
Computes the shortest path between the source and destination vertex. The algorithm only considers paths up to a length of k.
Implementation Details
null
Complexity
- Time:
O(E) with E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Path-finding applications where the path should be / can be limited by a certain number of hops.
- Parameters:
graph
- the graph.src
- the source vertex.dst
- the destination vertex.maxHops
- the maximum number of edges to follow when trying to find a path.highDegreeVertexMapping
- the high-degree vertices.highDegreeVertices
- the high-degree vertices.index
- index containing distances to high-degree vertices.filter
- filter to be evaluated on the edges when searching for a path.pathVertices
- (out-argument) will contain the vertices on the found path or will be empty if there is none.pathEdges
- (out-argument) will contain the vertices on the found path or will be empty if there is none.- Returns:
- A pair containing the vertices in the shortest path from
src
todst
and the edges on the path. Both will be empty if there is no path withinmaxHops
steps.
- Time:
-
limitedShortestPathHopDistFilteredAsync
public <ID> PgxFuture<Pair<VertexSequence<ID>,EdgeSequence>> limitedShortestPathHopDistFilteredAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, int maxHops, PgxMap<java.lang.Integer,PgxVertex<ID>> highDegreeVertexMapping, VertexSet<ID> highDegreeVertices, VertexProperty<ID,PgxVect<java.lang.Integer>> index, EdgeFilter filter)
Computes the k-hop limited shortest path between two vertices.
Definition
Computes the shortest path between the source and destination vertex. The algorithm only considers paths up to a length of k.
Implementation Details
null
Complexity
- Time:
O(E) with E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Path-finding applications where the path should be / can be limited by a certain number of hops.
- Parameters:
graph
- the graph.src
- the source vertex.dst
- the destination vertex.maxHops
- the maximum number of edges to follow when trying to find a path.highDegreeVertexMapping
- the high-degree vertices.highDegreeVertices
- the high-degree vertices.index
- index containing distances to high-degree vertices.filter
- filter to be evaluated on the edges when searching for a path.- Returns:
- A pair containing the vertices in the shortest path from
src
todst
and the edges on the path. Both will be empty if there is no path withinmaxHops
steps.
- Time:
-
allReachableVerticesEdgesAsync
public <ID> PgxFuture<org.apache.commons.lang3.tuple.Triple<VertexSet<ID>,EdgeSet,PgxMap<PgxVertex<ID>,java.lang.Integer>>> allReachableVerticesEdgesAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, int k)
Finds all the vertices and edges on a path between the src and target of length smaller or equal to k.
Definition
Finds all the vertices and edges on a path between the src and target of length smaller or equal to k.
Implementation Details
null
Complexity
- Time:
O(E) with E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Parameters:
graph
- the graph.src
- the source vertex.dst
- the destination vertex.k
- the dimension of the distances property; i.e. number of high-degree vertices.- Returns:
- a
Triple
containing a vertex-set with the vertices on the path, an edge-set with the edges on the path and a map containing the distances from the source vertex for each vertex on the path
- Time:
-
allReachableVerticesEdgesFilteredAsync
public <ID> PgxFuture<org.apache.commons.lang3.tuple.Triple<VertexSet<ID>,EdgeSet,PgxMap<PgxVertex<ID>,java.lang.Integer>>> allReachableVerticesEdgesFilteredAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, int k, EdgeFilter filter)
Finds all the vertices and edges on a path between the src and target of length smaller or equal to k.
Definition
Finds all the vertices and edges on a path between the src and target of length smaller or equal to k.
Implementation Details
null
Complexity
- Time:
O(E) with E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Parameters:
graph
- the graph.src
- the source vertex.dst
- the destination vertex.k
- the dimension of the distances property; i.e. number of high-degree vertices.filter
- the filter to be used on edges when searching for a path.- Returns:
- a
Triple
containing a vertex-set with the vertices on the path, an edge-set with the edges on the path and a map containing the distances from the source vertex for each vertex on the path
- Time:
-
enumerateSimplePathsAsync
public <ID> PgxFuture<org.apache.commons.lang3.tuple.Triple<ScalarSequence<java.lang.Integer>,VertexSequence<ID>,EdgeSequence>> enumerateSimplePathsAsync(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, int k, VertexSet verticesOnPath, EdgeSet edgesOnPath, PgxMap<PgxVertex<ID>,java.lang.Integer> dist)
Enumerate all simple paths between the source and destination vertex
Definition
Enumerate all simple paths between the source and destination vertex
Implementation Details
null
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Parameters:
graph
- the graph.src
- the source vertex.dst
- the destination vertex.k
- the dimension of the distances property; i.e. number of high-degree vertices.verticesOnPath
- the vertices on the path.edgesOnPath
- the edges on the path.dist
- map containing the distance from the source vertex for each vertex on a path.- Returns:
- a
Triple
containing a sequence containing the path lengths, a vertex-sequence containing the vertices on the paths and an edge-sequence containing the edges on the paths
- Time:
-
bipartiteCheckAsync
public <ID> PgxFuture<VertexProperty<ID,java.lang.Boolean>> bipartiteCheckAsync(PgxGraph graph, VertexProperty<ID,java.lang.Boolean> isLeft)
Bipartite check verifies whether are graph is a bipartite graph.
Definition
This algorithm checks whether the given directed graph is bipartite. It assumes that all the edges are going in the same direction since the method relies on BFS traversals of the graph. If the graph is bipartite the algorithm will return the side of each vertex in the graph with the is_left vertex property.
Implementation Details
The implementation of this algorithm uses a built-in BFS method for the graph traversals.
Complexity
- Time:
O(E) with E = number of edges
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- Checking whether a graph is a bipartite one is important since some other graph algorithms rely on this particular condition.
- Parameters:
graph
- the graph.isLeft
- vertex property holding the side of each vertex in a bipartite graph (true for left, false for right).- Returns:
- vertex property holding the side of each vertex in a bipartite graph (true for left, false for right).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Boolean> isLeft = graph.createVertexProperty(PropertyType.BOOLEAN); PgxFuture<VertexProperty<Integer, Boolean>> promise = analyst.BipartiteCheck(graph, isLeft);
- See Also:
- Bipartite Graph.
- Time:
-
destroyAsync
public PgxFuture<java.lang.Void> destroyAsync()
Description copied from class:Destroyable
Requests destruction of this object. After this method returns, the behavior of any method of this class becomes undefined.- Specified by:
destroyAsync
in classDestroyable
- Returns:
- a future which will be completed once the destruction request finishes.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
pagerank
public <ID> VertexProperty<ID,java.lang.Double> pagerank(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
PageRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
PageRank is an algorithm that computes ranking scores for the vertices using the network created by the incoming edges in the graph. Thus it is intended for directed graphs, although undirected graphs can be treated as well by converting them into directed graphs with reciprocated edges (i.e. keeping the original edge and creating a second one going in the opposite direction). The edges on the graph will define the relevance of each vertex in the graph, reflecting this on the scores, meaning that greater scores will correspond to vertices with greater relevance.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
- max_iter: 100
Applications
- PageRank can be used to measure the relative importance of documents which are linked together, such as the World Wide Web. The computed rank represents a probability distribution of the likelihood that a person randomly clicking on links will arrive at any particular page.
- Parameters:
graph
- the graph.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> pagerank = analyst.pagerank(graph); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
pagerank
public <ID> VertexProperty<ID,java.lang.Double> pagerank(PgxGraph graph, boolean norm) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
PageRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
PageRank is an algorithm that computes ranking scores for the vertices using the network created by the incoming edges in the graph. Thus it is intended for directed graphs, although undirected graphs can be treated as well by converting them into directed graphs with reciprocated edges (i.e. keeping the original edge and creating a second one going in the opposite direction). The edges on the graph will define the relevance of each vertex in the graph, reflecting this on the scores, meaning that greater scores will correspond to vertices with greater relevance.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
- max_iter: 100
Applications
- PageRank can be used to measure the relative importance of documents which are linked together, such as the World Wide Web. The computed rank represents a probability distribution of the likelihood that a person randomly clicking on links will arrive at any particular page.
- Parameters:
graph
- the graph.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> pagerank = analyst.pagerank(graph, false); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
pagerank
public <ID> VertexProperty<ID,java.lang.Double> pagerank(PgxGraph graph, double e, double d, int max) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
PageRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
PageRank is an algorithm that computes ranking scores for the vertices using the network created by the incoming edges in the graph. Thus it is intended for directed graphs, although undirected graphs can be treated as well by converting them into directed graphs with reciprocated edges (i.e. keeping the original edge and creating a second one going in the opposite direction). The edges on the graph will define the relevance of each vertex in the graph, reflecting this on the scores, meaning that greater scores will correspond to vertices with greater relevance.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
- max_iter: 100
Applications
- PageRank can be used to measure the relative importance of documents which are linked together, such as the World Wide Web. The computed rank represents a probability distribution of the likelihood that a person randomly clicking on links will arrive at any particular page.
- Parameters:
graph
- the graph.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> pagerank = analyst.pagerank(graph, 0.001, 0.85, 100); PgqlResultSet rs = graph.queryPgql("SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
pagerank
public <ID> VertexProperty<ID,java.lang.Double> pagerank(PgxGraph graph, double e, double d, int max, boolean norm) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
PageRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
PageRank is an algorithm that computes ranking scores for the vertices using the network created by the incoming edges in the graph. Thus it is intended for directed graphs, although undirected graphs can be treated as well by converting them into directed graphs with reciprocated edges (i.e. keeping the original edge and creating a second one going in the opposite direction). The edges on the graph will define the relevance of each vertex in the graph, reflecting this on the scores, meaning that greater scores will correspond to vertices with greater relevance.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
- max_iter: 100
Applications
- PageRank can be used to measure the relative importance of documents which are linked together, such as the World Wide Web. The computed rank represents a probability distribution of the likelihood that a person randomly clicking on links will arrive at any particular page.
- Parameters:
graph
- the graph.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> pagerank = analyst.pagerank(graph, 0.001, 0.85, 100, false); PgqlResultSet rs = graph.queryPgql("SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
pagerank
public <ID> VertexProperty<ID,java.lang.Double> pagerank(PgxGraph graph, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
PageRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
PageRank is an algorithm that computes ranking scores for the vertices using the network created by the incoming edges in the graph. Thus it is intended for directed graphs, although undirected graphs can be treated as well by converting them into directed graphs with reciprocated edges (i.e. keeping the original edge and creating a second one going in the opposite direction). The edges on the graph will define the relevance of each vertex in the graph, reflecting this on the scores, meaning that greater scores will correspond to vertices with greater relevance.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
- max_iter: 100
Applications
- PageRank can be used to measure the relative importance of documents which are linked together, such as the World Wide Web. The computed rank represents a probability distribution of the likelihood that a person randomly clicking on links will arrive at any particular page.
- Parameters:
graph
- the graph.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> pagerank = analyst.pagerank(graph, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
pagerank
public <ID> VertexProperty<ID,java.lang.Double> pagerank(PgxGraph graph, boolean norm, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
PageRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
PageRank is an algorithm that computes ranking scores for the vertices using the network created by the incoming edges in the graph. Thus it is intended for directed graphs, although undirected graphs can be treated as well by converting them into directed graphs with reciprocated edges (i.e. keeping the original edge and creating a second one going in the opposite direction). The edges on the graph will define the relevance of each vertex in the graph, reflecting this on the scores, meaning that greater scores will correspond to vertices with greater relevance.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
- max_iter: 100
Applications
- PageRank can be used to measure the relative importance of documents which are linked together, such as the World Wide Web. The computed rank represents a probability distribution of the likelihood that a person randomly clicking on links will arrive at any particular page.
- Parameters:
graph
- the graph.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> pagerank = analyst.pagerank(graph, false, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
pagerank
public <ID> VertexProperty<ID,java.lang.Double> pagerank(PgxGraph graph, double e, double d, int max, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
PageRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
PageRank is an algorithm that computes ranking scores for the vertices using the network created by the incoming edges in the graph. Thus it is intended for directed graphs, although undirected graphs can be treated as well by converting them into directed graphs with reciprocated edges (i.e. keeping the original edge and creating a second one going in the opposite direction). The edges on the graph will define the relevance of each vertex in the graph, reflecting this on the scores, meaning that greater scores will correspond to vertices with greater relevance.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
- max_iter: 100
Applications
- PageRank can be used to measure the relative importance of documents which are linked together, such as the World Wide Web. The computed rank represents a probability distribution of the likelihood that a person randomly clicking on links will arrive at any particular page.
- Parameters:
graph
- the graph.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> pagerank = analyst.pagerank(graph, 0.001, 0.85, 100, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
pagerank
public <ID> VertexProperty<ID,java.lang.Double> pagerank(PgxGraph graph, double e, double d, int max, boolean norm, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
PageRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
PageRank is an algorithm that computes ranking scores for the vertices using the network created by the incoming edges in the graph. Thus it is intended for directed graphs, although undirected graphs can be treated as well by converting them into directed graphs with reciprocated edges (i.e. keeping the original edge and creating a second one going in the opposite direction). The edges on the graph will define the relevance of each vertex in the graph, reflecting this on the scores, meaning that greater scores will correspond to vertices with greater relevance.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
- max_iter: 100
Applications
- PageRank can be used to measure the relative importance of documents which are linked together, such as the World Wide Web. The computed rank represents a probability distribution of the likelihood that a person randomly clicking on links will arrive at any particular page.
- Parameters:
graph
- the graph.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> pagerank = analyst.pagerank(graph, 0.001, 0.85, 100, false, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
pagerankApproximate
public <ID> VertexProperty<ID,java.lang.Double> pagerankApproximate(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Faster, but less accurate than pagerank. It compares and spots out important vertices in a graph
Definition
This variant of the PageRank algorithm computes the ranking scores for the vertices in similar way to the classic algorithm without normalization and with a more relaxed convergence criteria, since the tolerated error value is compared against each single vertex in the graph, instead of looking at the cumulative vertex error. Thus this variant will converge faster than the classic algorithm, but the ranking values might not be as accurate as in the classic implementation.
Implementation Details
The implementation of this algorithm uses an iterative method. The ranking values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- PageRank can be used to measure the relative importance of documents which are linked together, such as the World Wide Web. The computed rank represents a probability distribution of the likelihood that a person randomly clicking on links will arrive at any particular page.
- Parameters:
graph
- the graph.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> pagerank = analyst.pagerankApproximate(graph); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
pagerankApproximate
public <ID> VertexProperty<ID,java.lang.Double> pagerankApproximate(PgxGraph graph, double e, double d, int max) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Faster, but less accurate than pagerank. It compares and spots out important vertices in a graph
Definition
This variant of the PageRank algorithm computes the ranking scores for the vertices in similar way to the classic algorithm without normalization and with a more relaxed convergence criteria, since the tolerated error value is compared against each single vertex in the graph, instead of looking at the cumulative vertex error. Thus this variant will converge faster than the classic algorithm, but the ranking values might not be as accurate as in the classic implementation.
Implementation Details
The implementation of this algorithm uses an iterative method. The ranking values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- PageRank can be used to measure the relative importance of documents which are linked together, such as the World Wide Web. The computed rank represents a probability distribution of the likelihood that a person randomly clicking on links will arrive at any particular page.
- Parameters:
graph
- the graph.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> pagerank = analyst.pagerankApproximate(graph, 0.001, 0.85, 100); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
pagerankApproximate
public <ID> VertexProperty<ID,java.lang.Double> pagerankApproximate(PgxGraph graph, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Faster, but less accurate than pagerank. It compares and spots out important vertices in a graph
Definition
This variant of the PageRank algorithm computes the ranking scores for the vertices in similar way to the classic algorithm without normalization and with a more relaxed convergence criteria, since the tolerated error value is compared against each single vertex in the graph, instead of looking at the cumulative vertex error. Thus this variant will converge faster than the classic algorithm, but the ranking values might not be as accurate as in the classic implementation.
Implementation Details
The implementation of this algorithm uses an iterative method. The ranking values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- PageRank can be used to measure the relative importance of documents which are linked together, such as the World Wide Web. The computed rank represents a probability distribution of the likelihood that a person randomly clicking on links will arrive at any particular page.
- Parameters:
graph
- the graph.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> pagerank = analyst.pagerankApproximate(graph, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
pagerankApproximate
public <ID> VertexProperty<ID,java.lang.Double> pagerankApproximate(PgxGraph graph, double e, double d, int max, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Faster, but less accurate than pagerank. It compares and spots out important vertices in a graph
Definition
This variant of the PageRank algorithm computes the ranking scores for the vertices in similar way to the classic algorithm without normalization and with a more relaxed convergence criteria, since the tolerated error value is compared against each single vertex in the graph, instead of looking at the cumulative vertex error. Thus this variant will converge faster than the classic algorithm, but the ranking values might not be as accurate as in the classic implementation.
Implementation Details
The implementation of this algorithm uses an iterative method. The ranking values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- PageRank can be used to measure the relative importance of documents which are linked together, such as the World Wide Web. The computed rank represents a probability distribution of the likelihood that a person randomly clicking on links will arrive at any particular page.
- Parameters:
graph
- the graph.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> pagerank = analyst.pagerankApproximate(graph, 0.001, 0.85, 100, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
personalizedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedPagerank(PgxGraph graph, PgxVertex<ID> v) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized PageRank for a vertex of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexProperty<Integer, Double> pagerank = analyst.personalizedPagerank(graph, vertex); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedPagerank(PgxGraph graph, PgxVertex<ID> v, boolean norm) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized PageRank for a vertex of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset.
- Parameters:
graph
- the graph.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexProperty<Integer, Double> pagerank = analyst.personalizedPagerank(graph, vertex, false); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedPagerank(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized PageRank for a vertex of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexProperty<Integer, Double> pagerank = analyst.personalizedPagerank(graph, vertex, 0.001, 0.85, 100); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedPagerank(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max, boolean norm) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized PageRank for a vertex of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexProperty<Integer, Double> pagerank = analyst.personalizedPagerank(graph, vertex, 0.001, 0.85, 100, false); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedPagerank(PgxGraph graph, PgxVertex<ID> v, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized PageRank for a vertex of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> pagerank = analyst.personalizedPagerank(graph, vertex, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedPagerank(PgxGraph graph, PgxVertex<ID> v, boolean norm, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized PageRank for a vertex of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> pagerank = analyst.personalizedPagerank(graph, vertex, false, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedPagerank(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized PageRank for a vertex of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> pagerank = analyst.personalizedPagerank(graph, vertex, 0.001, 0.85, 100, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedPagerank(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max, boolean norm, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized PageRank for a vertex of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> pagerank = analyst.personalizedPagerank(graph, vertex, 0.001, 0.85, 100, false, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
weightedPagerank
public <ID> VertexProperty<ID,java.lang.Double> weightedPagerank(PgxGraph graph, EdgeProperty<java.lang.Double> weight) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
PageRank on weighted edges. It compares and spots out important vertices in a graph
Definition
The Weighted PageRank works like the original PageRank algorithm, except that it allows for a weight value assigned to each edge. This weight determines the fraction of the PageRank score that will flow from the source vertex through the current edge to its destination vertex.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It extends the scope of the PageRank applications by allowing edges with non-uniform weights, which can reflect better the structures underlying in graphs.
- Parameters:
graph
- the graph.weight
- edge property holding the weight of each edge in the graph.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> pagerank = analyst.weightedPagerank(graph, cost); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
weightedPagerank
public <ID> VertexProperty<ID,java.lang.Double> weightedPagerank(PgxGraph graph, boolean norm, EdgeProperty<java.lang.Double> weight) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
PageRank on weighted edges. It compares and spots out important vertices in a graph
Definition
The Weighted PageRank works like the original PageRank algorithm, except that it allows for a weight value assigned to each edge. This weight determines the fraction of the PageRank score that will flow from the source vertex through the current edge to its destination vertex.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It extends the scope of the PageRank applications by allowing edges with non-uniform weights, which can reflect better the structures underlying in graphs.
- Parameters:
graph
- the graph.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.weight
- edge property holding the weight of each edge in the graph.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> pagerank = analyst.weightedPagerank(graph, false, cost); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
weightedPagerank
public <ID> VertexProperty<ID,java.lang.Double> weightedPagerank(PgxGraph graph, double e, double d, int max, EdgeProperty<java.lang.Double> weight) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
PageRank on weighted edges. It compares and spots out important vertices in a graph
Definition
The Weighted PageRank works like the original PageRank algorithm, except that it allows for a weight value assigned to each edge. This weight determines the fraction of the PageRank score that will flow from the source vertex through the current edge to its destination vertex.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It extends the scope of the PageRank applications by allowing edges with non-uniform weights, which can reflect better the structures underlying in graphs.
- Parameters:
graph
- the graph.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.weight
- edge property holding the weight of each edge in the graph.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> pagerank = analyst.weightedPagerank(graph, 0.001, 0.85, 100, cost); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
weightedPagerank
public <ID> VertexProperty<ID,java.lang.Double> weightedPagerank(PgxGraph graph, double e, double d, int max, boolean norm, EdgeProperty<java.lang.Double> weight) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
PageRank on weighted edges. It compares and spots out important vertices in a graph
Definition
The Weighted PageRank works like the original PageRank algorithm, except that it allows for a weight value assigned to each edge. This weight determines the fraction of the PageRank score that will flow from the source vertex through the current edge to its destination vertex.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It extends the scope of the PageRank applications by allowing edges with non-uniform weights, which can reflect better the structures underlying in graphs.
- Parameters:
graph
- the graph.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.weight
- edge property holding the weight of each edge in the graph.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> pagerank = analyst.weightedPagerank(graph, 0.001, 0.85, 100, false, cost); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
weightedPagerank
public <ID> VertexProperty<ID,java.lang.Double> weightedPagerank(PgxGraph graph, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
PageRank on weighted edges. It compares and spots out important vertices in a graph
Definition
The Weighted PageRank works like the original PageRank algorithm, except that it allows for a weight value assigned to each edge. This weight determines the fraction of the PageRank score that will flow from the source vertex through the current edge to its destination vertex.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It extends the scope of the PageRank applications by allowing edges with non-uniform weights, which can reflect better the structures underlying in graphs.
- Parameters:
graph
- the graph.weight
- edge property holding the weight of each edge in the graph.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> pagerank = analyst.weightedPagerank(graph, cost, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
weightedPagerank
public <ID> VertexProperty<ID,java.lang.Double> weightedPagerank(PgxGraph graph, boolean norm, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
PageRank on weighted edges. It compares and spots out important vertices in a graph
Definition
The Weighted PageRank works like the original PageRank algorithm, except that it allows for a weight value assigned to each edge. This weight determines the fraction of the PageRank score that will flow from the source vertex through the current edge to its destination vertex.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It extends the scope of the PageRank applications by allowing edges with non-uniform weights, which can reflect better the structures underlying in graphs.
- Parameters:
graph
- the graph.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.weight
- edge property holding the weight of each edge in the graph.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> pagerank = analyst.weightedPagerank(graph, false, cost, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
weightedPagerank
public <ID> VertexProperty<ID,java.lang.Double> weightedPagerank(PgxGraph graph, double e, double d, int max, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
PageRank on weighted edges. It compares and spots out important vertices in a graph
Definition
The Weighted PageRank works like the original PageRank algorithm, except that it allows for a weight value assigned to each edge. This weight determines the fraction of the PageRank score that will flow from the source vertex through the current edge to its destination vertex.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It extends the scope of the PageRank applications by allowing edges with non-uniform weights, which can reflect better the structures underlying in graphs.
- Parameters:
graph
- the graph.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.weight
- edge property holding the weight of each edge in the graph.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> pagerank = analyst.weightedPagerank(graph, 0.001, 0.85, 100, cost, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
weightedPagerank
public <ID> VertexProperty<ID,java.lang.Double> weightedPagerank(PgxGraph graph, double e, double d, int max, boolean norm, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
PageRank on weighted edges. It compares and spots out important vertices in a graph
Definition
The Weighted PageRank works like the original PageRank algorithm, except that it allows for a weight value assigned to each edge. This weight determines the fraction of the PageRank score that will flow from the source vertex through the current edge to its destination vertex.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It extends the scope of the PageRank applications by allowing edges with non-uniform weights, which can reflect better the structures underlying in graphs.
- Parameters:
graph
- the graph.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.weight
- edge property holding the weight of each edge in the graph.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> pagerank = analyst.weightedPagerank(graph, 0.001, 0.85, 100, false, cost, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
personalizedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedPagerank(PgxGraph graph, VertexSet<ID> vertices) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized PageRank for a set of vertices of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset of vertices.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); VertexProperty<Integer, Double> pagerank = analyst.personalizedPagerank(graph, vertices); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedPagerank(PgxGraph graph, VertexSet<ID> vertices, boolean norm) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized PageRank for a set of vertices of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset of vertices.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); VertexProperty<Integer, Double> pagerank = analyst.personalizedPagerank(graph, vertices, false); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedPagerank(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized PageRank for a set of vertices of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset of vertices.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); VertexProperty<Integer, Double> pagerank = analyst.personalizedPagerank(graph, vertices, 0.001, 0.85, 100); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedPagerank(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max, boolean norm) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized PageRank for a set of vertices of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset of vertices.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); VertexProperty<Integer, Double> pagerank = analyst.personalizedPagerank(graph, vertices, 0.001, 0.85, 100, false); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedPagerank(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized PageRank for a set of vertices of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset of vertices.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> pagerank = analyst.personalizedPagerank(graph, vertices, 0.001, 0.85, 100, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedPagerank(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max, boolean norm, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized PageRank for a set of vertices of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset of vertices.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> pagerank = analyst.personalizedPagerank(graph, vertices, 0.001, 0.85, 100, false, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedPagerank(PgxGraph graph, VertexSet<ID> vertices, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized PageRank for a set of vertices of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset of vertices.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> pagerank = analyst.personalizedPagerank(graph, vertices, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedPagerank(PgxGraph graph, VertexSet<ID> vertices, boolean norm, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized PageRank for a set of vertices of interest. It compares and spots out important vertices in a graph
Definition
The Personalized Pagerank allows to select a particular vertex or a set of vertices from the given graph in order to give them a greater importance when computing the ranking score, which will have as result a personalized Pagerank score and reveal relevant (or similar) vertices to the ones chosen at the beginning.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It introduces the concept of personalization for the PageRank applications, which allows to get relevant information from the given subset of vertices.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> pagerank = analyst.personalizedPagerank(graph, vertices, false, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedWeightedPagerank(PgxGraph graph, PgxVertex<ID> v, EdgeProperty<java.lang.Double> weight) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized weighted pagerank for a vertex and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.weight
- edge property holding the weight of each edge in the graph.- Returns:
- vertex property holding the (normalized) weighted PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> pagerank = analyst.personalizedWeightedPagerank(graph, vertex, cost); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedWeightedPagerank(PgxGraph graph, PgxVertex<ID> v, boolean norm, EdgeProperty<java.lang.Double> weight) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized weighted pagerank for a vertex and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.weight
- edge property holding the weight of each edge in the graph.- Returns:
- vertex property holding the (normalized) weighted PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> pagerank = analyst.personalizedWeightedPagerank(graph, vertex, false, cost); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedWeightedPagerank(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max, EdgeProperty<java.lang.Double> weight) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized weighted pagerank for a vertex and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.weight
- edge property holding the weight of each edge in the graph.- Returns:
- vertex property holding the (normalized) weighted PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> pagerank = analyst.personalizedWeightedPagerank(graph, vertex, 0.001, 0.85, 100, cost); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedWeightedPagerank(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max, boolean norm, EdgeProperty<java.lang.Double> weight) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized weighted pagerank for a vertex and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.weight
- edge property holding the weight of each edge in the graph.- Returns:
- vertex property holding the (normalized) weighted PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> pagerank = analyst.personalizedWeightedPagerank(graph, vertex, 0.001, 0.85, 100, false, cost); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedWeightedPagerank(PgxGraph graph, PgxVertex<ID> v, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized weighted pagerank for a vertex and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.weight
- edge property holding the weight of each edge in the graph.rank
- (out argument) vertex property holding the (normalized) weighted PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) weighted PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> pagerank = analyst.personalizedWeightedPagerank(graph, vertex, cost, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedWeightedPagerank(PgxGraph graph, PgxVertex<ID> v, boolean norm, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized weighted pagerank for a vertex and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.weight
- edge property holding the weight of each edge in the graph.rank
- (out argument) vertex property holding the (normalized) weighted PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) weighted PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> pagerank = analyst.personalizedWeightedPagerank(graph, vertex, false, cost, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedWeightedPagerank(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized weighted pagerank for a vertex and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.weight
- edge property holding the weight of each edge in the graph.rank
- (out argument) vertex property holding the (normalized) weighted PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) weighted PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> pagerank = analyst.personalizedWeightedPagerank(graph, vertex, 0.001, 0.85, 100, cost, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedWeightedPagerank(PgxGraph graph, PgxVertex<ID> v, double e, double d, int max, boolean norm, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized weighted pagerank for a vertex and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.v
- the chosen vertex from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.weight
- edge property holding the weight of each edge in the graph.rank
- (out argument) vertex property holding the (normalized) weighted PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) weighted PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> pagerank = analyst.personalizedWeightedPagerank(graph, vertex, 0.001, 0.85, 100, false, cost, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedWeightedPagerank(PgxGraph graph, VertexSet<ID> vertices, EdgeProperty<java.lang.Double> weight) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized pagerank for a set of vertices and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.weight
- edge property holding the weight of each edge in the graph.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> pagerank = analyst.personalizedWeightedPagerank(graph, vertices, cost); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedWeightedPagerank(PgxGraph graph, VertexSet<ID> vertices, boolean norm, EdgeProperty<java.lang.Double> weight) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized pagerank for a set of vertices and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.weight
- edge property holding the weight of each edge in the graph.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> pagerank = analyst.personalizedWeightedPagerank(graph, vertices, false, cost); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedWeightedPagerank(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max, EdgeProperty<java.lang.Double> weight) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized pagerank for a set of vertices and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.weight
- edge property holding the weight of each edge in the graph.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> pagerank = analyst.personalizedWeightedPagerank(graph, vertices, 0.001, 0.85, 100, cost); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedWeightedPagerank(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max, boolean norm, EdgeProperty<java.lang.Double> weight) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized pagerank for a set of vertices and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.weight
- edge property holding the weight of each edge in the graph.- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> pagerank = analyst.personalizedWeightedPagerank(graph, vertices, 0.001, 0.85, 100, false, cost); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedWeightedPagerank(PgxGraph graph, VertexSet<ID> vertices, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized pagerank for a set of vertices and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.weight
- edge property holding the weight of each edge in the graph.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> pagerank = analyst.personalizedWeightedPagerank(graph, vertices, cost, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedWeightedPagerank(PgxGraph graph, VertexSet<ID> vertices, boolean norm, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized pagerank for a set of vertices and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.weight
- edge property holding the weight of each edge in the graph.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> pagerank = analyst.personalizedWeightedPagerank(graph, vertices, false, cost, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedWeightedPagerank(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized pagerank for a set of vertices and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.weight
- edge property holding the weight of each edge in the graph.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> pagerank = analyst.personalizedWeightedPagerank(graph, vertices, 0.001, 0.85, 100, cost, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
personalizedWeightedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedWeightedPagerank(PgxGraph graph, VertexSet<ID> vertices, double e, double d, int max, boolean norm, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized pagerank for a set of vertices and weighted edges. It compares and spots out important vertices in a graph
Definition
The Personalized Weighted Pagerank combines elements from the weighted and the personalized versions in order to make the personalization of the results more unique, since both: the selection of a subset of vertices and the inclusion of specific weights in the edges, will help to set the importance of the ranking scores when these are being computed.
Implementation Details
The implementation of this algorithm uses an iterative method. The PageRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- This variant takes the personalization of the ranking scores a step further, thus its use is suggested when looking for highly personalized results.
- Parameters:
graph
- the graph.vertices
- the set of chosen vertices from the graph for personalization.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.weight
- edge property holding the weight of each edge in the graph.rank
- (out argument) vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) PageRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> pagerank = analyst.personalizedWeightedPagerank(graph, vertices, 0.001, 0.85, 100, false, cost, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + pagerank.getName() + " MATCH (x) ORDER BY x." + pagerank.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Anatomy of a Large-Scale Hypertextual Web Search Engine
- Time:
-
articleRank
public <ID> VertexProperty<ID,java.lang.Double> articleRank(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
ArticleRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
ArticleRank is a variant of the PageRank algorithm and operates in a similar way. It computes the ranking score for the vertices by analyzing the incoming edges, while reducing the assumption that relationships with nodes that have a low out-degree are of higher importance.
Implementation Details
The implementation of this algorithm uses an iterative method. The ArticleRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- ArticleRank can be used to measure the influence of articles and academic papers based on their citation analysis. The computed rank indicates how frequently an article is cited.
- Parameters:
graph
- the graph.- Returns:
- vertex property holding the (normalized) ArticleRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> articlerank = analyst.articleRank(graph); PgqlResultSet query = graph.queryPgql( "SELECT x, x." + articlerank.getName() + " MATCH (x) ORDER BY x." + articlerank.getName() + " DESC"); query.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
articleRank
public <ID> VertexProperty<ID,java.lang.Double> articleRank(PgxGraph graph, boolean norm) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
ArticleRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
ArticleRank is a variant of the PageRank algorithm and operates in a similar way. It computes the ranking score for the vertices by analyzing the incoming edges, while reducing the assumption that relationships with nodes that have a low out-degree are of higher importance.
Implementation Details
The implementation of this algorithm uses an iterative method. The ArticleRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- ArticleRank can be used to measure the influence of articles and academic papers based on their citation analysis. The computed rank indicates how frequently an article is cited.
- Parameters:
graph
- the graph.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.- Returns:
- vertex property holding the (normalized) ArticleRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> articlerank = analyst.articleRank(graph, false); PgqlResultSet query = graph.queryPgql( "SELECT x, x." + articlerank.getName() + " MATCH (x) ORDER BY x." + articlerank.getName() + " DESC"); query.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
articleRank
public <ID> VertexProperty<ID,java.lang.Double> articleRank(PgxGraph graph, double e, double d, int max) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
ArticleRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
ArticleRank is a variant of the PageRank algorithm and operates in a similar way. It computes the ranking score for the vertices by analyzing the incoming edges, while reducing the assumption that relationships with nodes that have a low out-degree are of higher importance.
Implementation Details
The implementation of this algorithm uses an iterative method. The ArticleRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- ArticleRank can be used to measure the influence of articles and academic papers based on their citation analysis. The computed rank indicates how frequently an article is cited.
- Parameters:
graph
- the graph.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.- Returns:
- vertex property holding the (normalized) ArticleRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> articlerank = analyst.articleRank(graph, 0.001, 0.85, 100); PgqlResultSet query = graph.queryPgql( "SELECT x, x." + articlerank.getName() + " MATCH (x) ORDER BY x." + articlerank.getName() + " DESC"); query.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
articleRank
public <ID> VertexProperty<ID,java.lang.Double> articleRank(PgxGraph graph, double e, double d, int max, boolean norm) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
ArticleRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
ArticleRank is a variant of the PageRank algorithm and operates in a similar way. It computes the ranking score for the vertices by analyzing the incoming edges, while reducing the assumption that relationships with nodes that have a low out-degree are of higher importance.
Implementation Details
The implementation of this algorithm uses an iterative method. The ArticleRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- ArticleRank can be used to measure the influence of articles and academic papers based on their citation analysis. The computed rank indicates how frequently an article is cited.
- Parameters:
graph
- the graph.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.- Returns:
- vertex property holding the (normalized) ArticleRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> articlerank = analyst.articleRank(graph, 0.001, 0.85, 100, false); PgqlResultSet query = graph.queryPgql( "SELECT x, x." + articlerank.getName() + " MATCH (x) ORDER BY x." + articlerank.getName() + " DESC"); query.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
articleRank
public <ID> VertexProperty<ID,java.lang.Double> articleRank(PgxGraph graph, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
ArticleRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
ArticleRank is a variant of the PageRank algorithm and operates in a similar way. It computes the ranking score for the vertices by analyzing the incoming edges, while reducing the assumption that relationships with nodes that have a low out-degree are of higher importance.
Implementation Details
The implementation of this algorithm uses an iterative method. The ArticleRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- ArticleRank can be used to measure the influence of articles and academic papers based on their citation analysis. The computed rank indicates how frequently an article is cited.
- Parameters:
graph
- the graph.rank
- (out argument) vertex property holding the (normalized) ArticleRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) ArticleRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> articlerank = analyst.articleRank(graph, rank); PgqlResultSet query = graph.queryPgql( "SELECT x, x." + articlerank.getName() + " MATCH (x) ORDER BY x." + articlerank.getName() + " DESC"); query.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
articleRank
public <ID> VertexProperty<ID,java.lang.Double> articleRank(PgxGraph graph, boolean norm, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
ArticleRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
ArticleRank is a variant of the PageRank algorithm and operates in a similar way. It computes the ranking score for the vertices by analyzing the incoming edges, while reducing the assumption that relationships with nodes that have a low out-degree are of higher importance.
Implementation Details
The implementation of this algorithm uses an iterative method. The ArticleRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- ArticleRank can be used to measure the influence of articles and academic papers based on their citation analysis. The computed rank indicates how frequently an article is cited.
- Parameters:
graph
- the graph.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.rank
- (out argument) vertex property holding the (normalized) ArticleRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) ArticleRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> articlerank = analyst.articleRank(graph, false, rank); PgqlResultSet query = graph.queryPgql( "SELECT x, x." + articlerank.getName() + " MATCH (x) ORDER BY x." + articlerank.getName() + " DESC"); query.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
articleRank
public <ID> VertexProperty<ID,java.lang.Double> articleRank(PgxGraph graph, double e, double d, int max, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
ArticleRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
ArticleRank is a variant of the PageRank algorithm and operates in a similar way. It computes the ranking score for the vertices by analyzing the incoming edges, while reducing the assumption that relationships with nodes that have a low out-degree are of higher importance.
Implementation Details
The implementation of this algorithm uses an iterative method. The ArticleRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- ArticleRank can be used to measure the influence of articles and academic papers based on their citation analysis. The computed rank indicates how frequently an article is cited.
- Parameters:
graph
- the graph.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.rank
- (out argument) vertex property holding the (normalized) ArticleRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) ArticleRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> articlerank = analyst.articleRank(graph, 0.001, 0.85, 100, rank); PgqlResultSet query = graph.queryPgql( "SELECT x, x." + articlerank.getName() + " MATCH (x) ORDER BY x." + articlerank.getName() + " DESC"); query.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
articleRank
public <ID> VertexProperty<ID,java.lang.Double> articleRank(PgxGraph graph, double e, double d, int max, boolean norm, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
ArticleRank computes ranking scores based on the edges in a graph. It compares and spots out important vertices in a graph
Definition
ArticleRank is a variant of the PageRank algorithm and operates in a similar way. It computes the ranking score for the vertices by analyzing the incoming edges, while reducing the assumption that relationships with nodes that have a low out-degree are of higher importance.
Implementation Details
The implementation of this algorithm uses an iterative method. The ArticleRank values of all the vertices in the graph are computed, hence updated, at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- ArticleRank can be used to measure the influence of articles and academic papers based on their citation analysis. The computed rank indicates how frequently an article is cited.
- Parameters:
graph
- the graph.e
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.d
- damping factor.max
- maximum number of iterations that will be performed.norm
- boolean flag to determine whether the algorithm will take into account dangling vertices for the ranking scores.rank
- (out argument) vertex property holding the (normalized) ArticleRank value for each vertex (a value between 0 and 1).- Returns:
- vertex property holding the (normalized) ArticleRank value for each vertex (a value between 0 and 1).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> articlerank = analyst.articleRank(graph, 0.001, 0.85, 100, false, rank); PgqlResultSet query = graph.queryPgql( "SELECT x, x." + articlerank.getName() + " MATCH (x) ORDER BY x." + articlerank.getName() + " DESC"); query.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
vertexBetweennessCentrality
public <ID> VertexProperty<ID,java.lang.Double> vertexBetweennessCentrality(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Betweenness centrality measures the centrality of the vertices to identify important vertices for the flow of information
Definition
The Betweenness Centrality of a vertex V in a graph is the sum of the fraction of shortest paths that pass through V from all the possible shortest paths connecting every possible pair of vertices S, T in the graph, such that V is different from S and T. Because of its definition, the algorithm is meant for connected graphs.
Implementation Details
The implementation of this algorithm uses a parallel BFS method called Multi-Source BFS (MS-BSF) for a faster and more efficient search of the shortests paths. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- The coefficient from betweenness centrality can be used to identify vertices in a graph that are vital for the flow of information within it, making it a good option for applications in social networks and problems modelling flows of any kind.
- Parameters:
graph
- the graph.- Returns:
- vertex property holding the betweenness centrality value for each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> betweenness = analyst.vertexBetweennessCentrality(graph); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + betweenness.getName() + " MATCH (x) ORDER BY x." + betweenness.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
vertexBetweennessCentrality
public <ID> VertexProperty<ID,java.lang.Double> vertexBetweennessCentrality(PgxGraph graph, VertexProperty<ID,java.lang.Double> bc) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Betweenness centrality measures the centrality of the vertices to identify important vertices for the flow of information
Definition
The Betweenness Centrality of a vertex V in a graph is the sum of the fraction of shortest paths that pass through V from all the possible shortest paths connecting every possible pair of vertices S, T in the graph, such that V is different from S and T. Because of its definition, the algorithm is meant for connected graphs.
Implementation Details
The implementation of this algorithm uses a parallel BFS method called Multi-Source BFS (MS-BSF) for a faster and more efficient search of the shortests paths. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- The coefficient from betweenness centrality can be used to identify vertices in a graph that are vital for the flow of information within it, making it a good option for applications in social networks and problems modelling flows of any kind.
- Parameters:
graph
- the graph.bc
- (out argument) vertex property holding the betweenness centrality value for each vertex.- Returns:
- vertex property holding the betweenness centrality value for each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> bc = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> betweenness = analyst.vertexBetweennessCentrality(graph, bc); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + betweenness.getName() + " MATCH (x) ORDER BY x." + betweenness.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
approximateVertexBetweennessCentrality
public <ID> VertexProperty<ID,java.lang.Double> approximateVertexBetweennessCentrality(PgxGraph graph, int k) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Faster, but less accurate than betweenness centrality, it identifies important vertices for the flow of information
Definition
This variant of betweenness centrality approximates the centrality of the vertices by just using k random vertices as starting points for the BFS traversals of the graph, instead of computing the exact value by using all the vertices in the graph.
Implementation Details
The implementation of this algorithm uses a built-in BFS method for the graph traversals. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- The coefficient from betweenness centrality can be used to identify vertices in a graph that are vital for the flow of information within it, making it a good option for applications in social networks and problems modelling flows of any kind.
- Parameters:
graph
- the graph.k
- number of random vertices to be used to compute the approximated betweenness centrality coefficients.- Returns:
- vertex property holding the betweenness centrality value for each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> betweenness = analyst.approximateVertexBetweennessCentrality(graph, 100); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + betweenness.getName() + " MATCH (x) ORDER BY x." + betweenness.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
approximateVertexBetweennessCentrality
public <ID> VertexProperty<ID,java.lang.Double> approximateVertexBetweennessCentrality(PgxGraph graph, int k, VertexProperty<ID,java.lang.Double> bc) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Faster, but less accurate than betweenness centrality, it identifies important vertices for the flow of information
Definition
This variant of betweenness centrality approximates the centrality of the vertices by just using k random vertices as starting points for the BFS traversals of the graph, instead of computing the exact value by using all the vertices in the graph.
Implementation Details
The implementation of this algorithm uses a built-in BFS method for the graph traversals. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- The coefficient from betweenness centrality can be used to identify vertices in a graph that are vital for the flow of information within it, making it a good option for applications in social networks and problems modelling flows of any kind.
- Parameters:
graph
- the graph.k
- number of random vertices to be used to compute the approximated betweenness centrality coefficients.bc
- (out argument) vertex property holding the betweenness centrality value for each vertex.- Returns:
- vertex property holding the betweenness centrality value for each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> bc = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> betweenness = analyst.approximateVertexBetweennessCentrality(graph, 100, bc); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + betweenness.getName() + " MATCH (x) ORDER BY x." + betweenness.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
approximateVertexBetweennessCentralityFromSeeds
@SafeVarargs public final <ID> VertexProperty<ID,java.lang.Double> approximateVertexBetweennessCentralityFromSeeds(PgxGraph graph, PgxVertex<ID>... seeds) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Faster, but less accurate than betweenness centrality, it identifies important vertices for the flow of information
Definition
This variant of betweenness centrality approximates the centrality of the vertices by just using the vertices from the given sequence as starting points for the BFS traversals of the graph, instead of computing the exact value by using all the vertices in the graph.
Implementation Details
The implementation of this algorithm uses a built-in BFS method for the graph traversals. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- The coefficient from betweenness centrality can be used to identify vertices in a graph that are vital for the flow of information within it, making it a good option for applications in social networks and problems modelling flows of any kind.
- Parameters:
graph
- the graph.seeds
- the (unique) chosen nodes to be used to compute the approximated betweenness centrality coeficients.- Returns:
- vertex property holding the betweenness centrality value for each vertex.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexProperty<Integer, Double> betweenness = analyst.approximateVertexBetweennessCentralityFromSeeds(graph, vertex); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + betweenness.getName() + " MATCH (x) ORDER BY x." + betweenness.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
approximateVertexBetweennessCentralityFromSeeds
@SafeVarargs public final <ID> VertexProperty<ID,java.lang.Double> approximateVertexBetweennessCentralityFromSeeds(PgxGraph graph, VertexProperty<ID,java.lang.Double> bc, PgxVertex<ID>... seeds) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Faster, but less accurate than betweenness centrality, it identifies important vertices for the flow of information
Definition
This variant of betweenness centrality approximates the centrality of the vertices by just using the vertices from the given sequence as starting points for the BFS traversals of the graph, instead of computing the exact value by using all the vertices in the graph.
Implementation Details
The implementation of this algorithm uses a built-in BFS method for the graph traversals. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- The coefficient from betweenness centrality can be used to identify vertices in a graph that are vital for the flow of information within it, making it a good option for applications in social networks and problems modelling flows of any kind.
- Parameters:
graph
- the graph.bc
- (out argument) vertex property holding the betweenness centrality value for each vertex.seeds
- the (unique) chosen nodes to be used to compute the approximated betweenness centrality coeficients.- Returns:
- vertex property holding the betweenness centrality value for each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> bc = graph.createVertexProperty(PropertyType.DOUBLE); PgxVertex<Integer> vertex = graph.getVertex(128); VertexProperty<Integer, Double> betweenness = analyst.approximateVertexBetweennessCentralityFromSeeds(graph, bc, vertex); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + betweenness.getName() + " MATCH (x) ORDER BY x." + betweenness.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
closenessCentralityUnitLength
public <ID> VertexProperty<ID,java.lang.Double> closenessCentralityUnitLength(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Closeness centrality measures the centrality of the vertices based on distances, allowing to find well-connected vertices
Definition
The Closeness Centrality of a node V is the reciprocal of the sum of all the distances from the possible shortest paths starting from V. Thus the higher the centrality value of V, the closer it is to all the other vertices in the graph.
Implementation Details
The implementation of this algorithm uses a parallel BFS method called Multi-Source BFS (MS-BSF) for a faster and more efficient search of the shortests paths. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- The coefficient from closeness centrality can be used to identify vertices in a graph that are close and well connected to other vertices, hence it can be used in many applications for social networks when looking for vertices to spread information in a fast way.
- Parameters:
graph
- the graph.- Returns:
- node property holding the closeness centrality value for each node.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> closeness = analyst.closenessCentralityUnitLength(graph); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + closeness.getName() + " MATCH (x) ORDER BY x." + closeness.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
closenessCentralityUnitLength
public <ID> VertexProperty<ID,java.lang.Double> closenessCentralityUnitLength(PgxGraph graph, VertexProperty<ID,java.lang.Double> cc) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Closeness centrality measures the centrality of the vertices based on distances, allowing to find well-connected vertices
Definition
The Closeness Centrality of a node V is the reciprocal of the sum of all the distances from the possible shortest paths starting from V. Thus the higher the centrality value of V, the closer it is to all the other vertices in the graph.
Implementation Details
The implementation of this algorithm uses a parallel BFS method called Multi-Source BFS (MS-BSF) for a faster and more efficient search of the shortests paths. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- The coefficient from closeness centrality can be used to identify vertices in a graph that are close and well connected to other vertices, hence it can be used in many applications for social networks when looking for vertices to spread information in a fast way.
- Parameters:
graph
- the graph.cc
- (out argument) node property holding the closeness centrality value for each node.- Returns:
- node property holding the closeness centrality value for each node.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> cc = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> closeness = analyst.closenessCentralityUnitLength(graph, cc); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + closeness.getName() + " MATCH (x) ORDER BY x." + closeness.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
closenessCentralityDoubleLength
public <ID> VertexProperty<ID,java.lang.Double> closenessCentralityDoubleLength(PgxGraph graph, EdgeProperty<java.lang.Double> cost) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Closeness centrality measures the centrality of the vertices based on weighted distances, allowing to find well-connected vertices
Definition
This variant of Closeness Centrality takes into account the weights from the edges when computing the reciprocal of the sum of all the distances from the possible shortest paths starting from the vertex V, for every vertex in the graph. The weights of the edges must be positive values greater than 0.
Implementation Details
The implementation of is more expensive to compute than the normal closeness centrality because of the inclusion of the weights in the edges which influence the selection of edges for the shortest paths. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E * d) with E = number of edges, V = number of vertices, d = diameter of the graph
- Space:
O(5 * V) with V = number of vertices
Default Values
Applications
- The coefficient from closeness centrality can be used to identify vertices in a graph that are close and well connected to other vertices, hence it can be used in many applications for social networks when looking for vertices to spread information in a fast way.
- Parameters:
graph
- the graph.cost
- edge property holding the weight of each edge in the graph.- Returns:
- vertex property holding the closeness centrality value for each vertex.
Examples
PgxGraph graph = ...; EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> closeness = analyst.closenessCentralityDoubleLength(graph, cost); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + closeness.getName() + " MATCH (x) ORDER BY x." + closeness.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
closenessCentralityDoubleLength
public <ID> VertexProperty<ID,java.lang.Double> closenessCentralityDoubleLength(PgxGraph graph, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,java.lang.Double> cc) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Closeness centrality measures the centrality of the vertices based on weighted distances, allowing to find well-connected vertices
Definition
This variant of Closeness Centrality takes into account the weights from the edges when computing the reciprocal of the sum of all the distances from the possible shortest paths starting from the vertex V, for every vertex in the graph. The weights of the edges must be positive values greater than 0.
Implementation Details
The implementation of is more expensive to compute than the normal closeness centrality because of the inclusion of the weights in the edges which influence the selection of edges for the shortest paths. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E * d) with E = number of edges, V = number of vertices, d = diameter of the graph
- Space:
O(5 * V) with V = number of vertices
Default Values
Applications
- The coefficient from closeness centrality can be used to identify vertices in a graph that are close and well connected to other vertices, hence it can be used in many applications for social networks when looking for vertices to spread information in a fast way.
- Parameters:
graph
- the graph.cost
- edge property holding the weight of each edge in the graph.cc
- (out argument) vertex property holding the closeness centrality value for each vertex.- Returns:
- vertex property holding the closeness centrality value for each vertex.
Examples
PgxGraph graph = ...; EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> cc = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> closeness = analyst.closenessCentralityDoubleLength(graph, cost, cc); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + closeness.getName() + " MATCH (x) ORDER BY x." + closeness.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
hits
public <ID> Pair<VertexProperty<ID,java.lang.Double>,VertexProperty<ID,java.lang.Double>> hits(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
HITS assigns ranking scores to the vertices, aimed to assess the quality of information and references in linked structures
Definition
HITS is an algorithm that computes two ranking scores (authority and hub)for each vertex in the graph. The idea of hubs and authorities comes from the web pages: a hub is regarded as a page that is not authoritative in a specific topic, but it has instead links to authority pages, which are regarded as meaningful sources for a particular topic by many hubs. Thus a good hub will point to many authorities, while a good authority will be pointed by many hubs. The authority score of a vertex V is computed by adding all the hub scores of its incoming neighbors (i.e. vertices with edges pointing to V). The hub score is computed in a similar way, using the authority scores instead.
Implementation Details
The implementation of this algorithm uses an iterative method. Both, authority and hub scores, of all the vertices in the graph are computed and updated at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- HITS was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- the graph.- Returns:
- Pair holding the two vertex properties with the authority and hub scores.
Examples
PgxGraph graph = ...; Pair<VertexProperty<Integer, Double>, VertexProperty<Integer, Double>> hits = analyst.hits(graph); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + hits.getFirst().getName() + ", x." + hits.getSecond().getName() + " MATCH (x) ORDER BY x." + hits.getFirst().getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
hits
public <ID> Pair<VertexProperty<ID,java.lang.Double>,VertexProperty<ID,java.lang.Double>> hits(PgxGraph graph, int max) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
HITS assigns ranking scores to the vertices, aimed to assess the quality of information and references in linked structures
Definition
HITS is an algorithm that computes two ranking scores (authority and hub)for each vertex in the graph. The idea of hubs and authorities comes from the web pages: a hub is regarded as a page that is not authoritative in a specific topic, but it has instead links to authority pages, which are regarded as meaningful sources for a particular topic by many hubs. Thus a good hub will point to many authorities, while a good authority will be pointed by many hubs. The authority score of a vertex V is computed by adding all the hub scores of its incoming neighbors (i.e. vertices with edges pointing to V). The hub score is computed in a similar way, using the authority scores instead.
Implementation Details
The implementation of this algorithm uses an iterative method. Both, authority and hub scores, of all the vertices in the graph are computed and updated at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- HITS was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- the graph.max
- number of iterations that will be performed.- Returns:
- Pair holding the two vertex properties with the authority and hub scores.
Examples
PgxGraph graph = ...; Pair<VertexProperty<Integer, Double>, VertexProperty<Integer, Double>> hits = analyst.hits(graph, 100); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + hits.getFirst().getName() + ", x." + hits.getSecond().getName() + " MATCH (x) ORDER BY x." + hits.getFirst().getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
hits
public <ID> Pair<VertexProperty<ID,java.lang.Double>,VertexProperty<ID,java.lang.Double>> hits(PgxGraph graph, int max, VertexProperty<ID,java.lang.Double> auth, VertexProperty<ID,java.lang.Double> hubs) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
HITS assigns ranking scores to the vertices, aimed to assess the quality of information and references in linked structures
Definition
HITS is an algorithm that computes two ranking scores (authority and hub)for each vertex in the graph. The idea of hubs and authorities comes from the web pages: a hub is regarded as a page that is not authoritative in a specific topic, but it has instead links to authority pages, which are regarded as meaningful sources for a particular topic by many hubs. Thus a good hub will point to many authorities, while a good authority will be pointed by many hubs. The authority score of a vertex V is computed by adding all the hub scores of its incoming neighbors (i.e. vertices with edges pointing to V). The hub score is computed in a similar way, using the authority scores instead.
Implementation Details
The implementation of this algorithm uses an iterative method. Both, authority and hub scores, of all the vertices in the graph are computed and updated at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- HITS was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- the graph.max
- number of iterations that will be performed.auth
- (out argument) vertex property holding the authority score for each vertex.hubs
- (out argument) vertex property holding the hub score for each vertex.- Returns:
- Pair holding the two vertex properties with the authority and hub scores.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> auth = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> hubs = graph.createVertexProperty(PropertyType.DOUBLE); Pair<VertexProperty<Integer, Double>, VertexProperty<Integer, Double>> hits = analyst.hits(graph, 100, auth, hubs); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + hits.getFirst().getName() + ", x." + hits.getSecond().getName() + " MATCH (x) ORDER BY x." + hits.getFirst().getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
hits
public <ID> Pair<VertexProperty<ID,java.lang.Double>,VertexProperty<ID,java.lang.Double>> hits(PgxGraph graph, VertexProperty<ID,java.lang.Double> auth, VertexProperty<ID,java.lang.Double> hubs) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
HITS assigns ranking scores to the vertices, aimed to assess the quality of information and references in linked structures
Definition
HITS is an algorithm that computes two ranking scores (authority and hub)for each vertex in the graph. The idea of hubs and authorities comes from the web pages: a hub is regarded as a page that is not authoritative in a specific topic, but it has instead links to authority pages, which are regarded as meaningful sources for a particular topic by many hubs. Thus a good hub will point to many authorities, while a good authority will be pointed by many hubs. The authority score of a vertex V is computed by adding all the hub scores of its incoming neighbors (i.e. vertices with edges pointing to V). The hub score is computed in a similar way, using the authority scores instead.
Implementation Details
The implementation of this algorithm uses an iterative method. Both, authority and hub scores, of all the vertices in the graph are computed and updated at each iteration step.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- HITS was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- the graph.auth
- (out argument) vertex property holding the authority score for each vertex.hubs
- (out argument) vertex property holding the hub score for each vertex.- Returns:
- Pair holding the two vertex properties with the authority and hub scores.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> auth = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> hubs = graph.createVertexProperty(PropertyType.DOUBLE); Pair<VertexProperty<Integer, Double>, VertexProperty<Integer, Double>> hits = analyst.hits(graph, auth, hubs); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + hits.getFirst().getName() + ", x." + hits.getSecond().getName() + " MATCH (x) ORDER BY x." + hits.getFirst().getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
eigenvectorCentrality
public <ID> VertexProperty<ID,java.lang.Double> eigenvectorCentrality(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Eigenvector centrality gets the centrality of the vertices in an intricate way using neighbors, allowing to find well-connected vertices
Definition
The Eigenvector Centrality determines the centrality of a vertex by adding and weighting the centrality of its neighbors. Using outgoing or incoming edges when computing the eigenvector centrality will be equivalent to do so with the normal or the transpose adjacency matrix, respectively leading to the "right" and "left" eigenvectors.
Implementation Details
The implementation of this algorithm uses the power iteration method.
Complexity
- Time:
O(V * k) with V = number of vertices, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
- max_iter: 100
- max_diff: 0.001
- use_l2norm: false
- use_inEdges: false
Applications
- The eigenvector centrality assigns higher scores to vertices that are connected to other well-connected vertices in the graphs, making this algorithm a good option to find important or relevant people in social networks.
- Parameters:
graph
- the graph.- Returns:
- vertex property holding the normalized centrality value for each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> eigenvector = analyst.eigenvectorCentrality(graph); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + eigenvector.getName() + " MATCH (x) ORDER BY x." + eigenvector.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
eigenvectorCentrality
public <ID> VertexProperty<ID,java.lang.Double> eigenvectorCentrality(PgxGraph graph, int max, double maxDiff, boolean useL2Norm, boolean useInEdge) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Eigenvector centrality gets the centrality of the vertices in an intricate way using neighbors, allowing to find well-connected vertices
Definition
The Eigenvector Centrality determines the centrality of a vertex by adding and weighting the centrality of its neighbors. Using outgoing or incoming edges when computing the eigenvector centrality will be equivalent to do so with the normal or the transpose adjacency matrix, respectively leading to the "right" and "left" eigenvectors.
Implementation Details
The implementation of this algorithm uses the power iteration method.
Complexity
- Time:
O(V * k) with V = number of vertices, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
- max_iter: 100
- max_diff: 0.001
- use_l2norm: false
- use_inEdges: false
Applications
- The eigenvector centrality assigns higher scores to vertices that are connected to other well-connected vertices in the graphs, making this algorithm a good option to find important or relevant people in social networks.
- Parameters:
graph
- the graph.max
- maximum number of iterations that will be performed.maxDiff
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.useL2Norm
- boolean flag to determine whether the algorithm will use the l2 norm (Euclidean norm) or the l1 norm (absolute value) to normalize the centrality scores.useInEdge
- boolean flag to determine whether the algorithm will use the incoming or the outgoing edges in the graph for the computations.- Returns:
- vertex property holding the normalized centrality value for each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> eigenvector = analyst.eigenvectorCentrality(graph, 100, 0.001, false, false); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + eigenvector.getName() + " MATCH (x) ORDER BY x." + eigenvector.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
eigenvectorCentrality
public <ID> VertexProperty<ID,java.lang.Double> eigenvectorCentrality(PgxGraph graph, int max, double maxDiff, boolean useL2Norm, boolean useInEdge, VertexProperty<ID,java.lang.Double> ec) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Eigenvector centrality gets the centrality of the vertices in an intricate way using neighbors, allowing to find well-connected vertices
Definition
The Eigenvector Centrality determines the centrality of a vertex by adding and weighting the centrality of its neighbors. Using outgoing or incoming edges when computing the eigenvector centrality will be equivalent to do so with the normal or the transpose adjacency matrix, respectively leading to the "right" and "left" eigenvectors.
Implementation Details
The implementation of this algorithm uses the power iteration method.
Complexity
- Time:
O(V * k) with V = number of vertices, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
- max_iter: 100
- max_diff: 0.001
- use_l2norm: false
- use_inEdges: false
Applications
- The eigenvector centrality assigns higher scores to vertices that are connected to other well-connected vertices in the graphs, making this algorithm a good option to find important or relevant people in social networks.
- Parameters:
graph
- the graph.max
- maximum number of iterations that will be performed.maxDiff
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.useL2Norm
- boolean flag to determine whether the algorithm will use the l2 norm (Euclidean norm) or the l1 norm (absolute value) to normalize the centrality scores.useInEdge
- boolean flag to determine whether the algorithm will use the incoming or the outgoing edges in the graph for the computations.ec
- (out argument) vertex property holding the normalized centrality value for each vertex.- Returns:
- vertex property holding the normalized centrality value for each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> ec = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> eigenvector = analyst.eigenvectorCentrality(graph, 100, 0.001, false, false, ec); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + eigenvector.getName() + " MATCH (x) ORDER BY x." + eigenvector.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
eigenvectorCentrality
public <ID> VertexProperty<ID,java.lang.Double> eigenvectorCentrality(PgxGraph graph, VertexProperty<ID,java.lang.Double> ec) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Eigenvector centrality gets the centrality of the vertices in an intricate way using neighbors, allowing to find well-connected vertices
Definition
The Eigenvector Centrality determines the centrality of a vertex by adding and weighting the centrality of its neighbors. Using outgoing or incoming edges when computing the eigenvector centrality will be equivalent to do so with the normal or the transpose adjacency matrix, respectively leading to the "right" and "left" eigenvectors.
Implementation Details
The implementation of this algorithm uses the power iteration method.
Complexity
- Time:
O(V * k) with V = number of vertices, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
- max_iter: 100
- max_diff: 0.001
- use_l2norm: false
- use_inEdges: false
Applications
- The eigenvector centrality assigns higher scores to vertices that are connected to other well-connected vertices in the graphs, making this algorithm a good option to find important or relevant people in social networks.
- Parameters:
graph
- the graph.ec
- (out argument) vertex property holding the normalized centrality value for each vertex.- Returns:
- vertex property holding the normalized centrality value for each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> ec = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> eigenvector = analyst.eigenvectorCentrality(graph, ec); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + eigenvector.getName() + " MATCH (x) ORDER BY x." + eigenvector.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
outDegreeCentrality
public <ID> VertexProperty<ID,java.lang.Integer> outDegreeCentrality(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Out-degree centrality measures the centrality of the vertices based on its degree, letting you see how a vertex influences its neighborhood
Definition
Out-Degree centrality returns the sum of the number of outgoing edges for each vertex in the graph.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelism.
Complexity
- Time:
O(V) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Since out-degree centrality accounts for the connections of the vertices, it can be used to see the influence a vertex has over the vertices in its immediate neighborhood.
- Parameters:
graph
- the graph.- Returns:
- vertex property holding the degree centrality value for each vertex in the graph.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Integer> degree = analyst.outDegreeCentrality(graph); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + degree.getName() + " MATCH (x) ORDER BY x." + degree.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
outDegreeCentrality
public <ID> VertexProperty<ID,java.lang.Integer> outDegreeCentrality(PgxGraph graph, VertexProperty<ID,java.lang.Integer> dc) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Out-degree centrality measures the centrality of the vertices based on its degree, letting you see how a vertex influences its neighborhood
Definition
Out-Degree centrality returns the sum of the number of outgoing edges for each vertex in the graph.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelism.
Complexity
- Time:
O(V) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Since out-degree centrality accounts for the connections of the vertices, it can be used to see the influence a vertex has over the vertices in its immediate neighborhood.
- Parameters:
graph
- the graph.dc
- (out argument) vertex property holding the degree centrality value for each vertex in the graph.- Returns:
- vertex property holding the degree centrality value for each vertex in the graph.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Integer> dc = graph.createVertexProperty(PropertyType.INTEGER); VertexProperty<Integer, Integer> degree = analyst.outDegreeCentrality(graph, dc); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + degree.getName() + " MATCH (x) ORDER BY x." + degree.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
inDegreeCentrality
public <ID> VertexProperty<ID,java.lang.Integer> inDegreeCentrality(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
In-degree centrality measures the centrality of the vertices based on its degree, letting you see how a vertex influences its neighborhood
Definition
In-Degree centrality returns the sum of the number of incoming edges for each vertex in the graph.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelism.
Complexity
- Time:
O(V) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Since in-degree centrality accounts for the connections of the vertices, it can be used to see the influence a vertex has over the vertices in its immediate neighborhood.
- Parameters:
graph
- the graph.- Returns:
- vertex property holding the degree centrality value for each vertex in the graph.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Integer> degree = analyst.inDegreeCentrality(graph); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + degree.getName() + " MATCH (x) ORDER BY x." + degree.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
inDegreeCentrality
public <ID> VertexProperty<ID,java.lang.Integer> inDegreeCentrality(PgxGraph graph, VertexProperty<ID,java.lang.Integer> dc) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
In-degree centrality measures the centrality of the vertices based on its degree, letting you see how a vertex influences its neighborhood
Definition
In-Degree centrality returns the sum of the number of incoming edges for each vertex in the graph.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelism.
Complexity
- Time:
O(V) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Since in-degree centrality accounts for the connections of the vertices, it can be used to see the influence a vertex has over the vertices in its immediate neighborhood.
- Parameters:
graph
- the graph.dc
- (out argument) vertex property holding the degree centrality value for each vertex in the graph.- Returns:
- vertex property holding the degree centrality value for each vertex in the graph.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Integer> dc = graph.createVertexProperty(PropertyType.INTEGER); VertexProperty<Integer, Integer> degree = analyst.inDegreeCentrality(graph, dc); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + degree.getName() + " MATCH (x) ORDER BY x." + degree.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
degreeCentrality
public <ID> VertexProperty<ID,java.lang.Integer> degreeCentrality(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Degree centrality measures the centrality of the vertices based on its degree, letting you see how a vertex influences its neighborhood
Definition
Degree centrality counts the number of outgoing and incoming edges for each vertex in the graph.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Since degree centrality accounts for the connections of the vertices, it can be used to see the influence a vertex has over the vertices in its immediate neighborhood.
- Parameters:
graph
- the graph.- Returns:
- vertex property holding the degree centrality value for each vertex in the graph.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Integer> degree = analyst.degreeCentrality(graph); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + degree.getName() + " MATCH (x) ORDER BY x." + degree.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
degreeCentrality
public <ID> VertexProperty<ID,java.lang.Integer> degreeCentrality(PgxGraph graph, VertexProperty<ID,java.lang.Integer> dc) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Degree centrality measures the centrality of the vertices based on its degree, letting you see how a vertex influences its neighborhood
Definition
Degree centrality counts the number of outgoing and incoming edges for each vertex in the graph.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Since degree centrality accounts for the connections of the vertices, it can be used to see the influence a vertex has over the vertices in its immediate neighborhood.
- Parameters:
graph
- the graph.dc
- (out argument) vertex property holding the degree centrality value for each vertex in the graph.- Returns:
- vertex property holding the degree centrality value for each vertex in the graph.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Integer> dc = graph.createVertexProperty(PropertyType.INTEGER); VertexProperty<Integer, Integer> degree = analyst.degreeCentrality(graph, dc); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + degree.getName() + " MATCH (x) ORDER BY x." + degree.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
harmonicCentrality
public <ID> VertexProperty<ID,java.lang.Double> harmonicCentrality(PgxGraph graph, VertexProperty<ID,java.lang.Double> hc) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Harmonic centrality measures node importance by considering the reciprocal of the sum of shortest path distances in the network.
Definition
Harmonic centrality computes the centrality of each vertex by taking the reciprocal of the sum of the shortest path distances from that vertex to all other vertices in the graph. This metric highlights the importance of vertices that efficiently connect disparate parts of the network
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V * (V + E)) with V = number of vertices, E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Harmonic centrality can be applied in transportation networks to identify critical nodes that facilitate efficient travel between different destinations.
- Parameters:
graph
- the graph.hc
- (out argument) vertex property holding the harmonic centrality value for each vertex in the graph.- Returns:
- vertex property holding the harmonic centrality value for each vertex in the graph.
Examples
PgxGraph graph = ...; VertexProperty<Long, Double> hc = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Long, Double> harmonic = analyst.harmonicCentrality(graph, hc); PgqlResultSet query = graph.queryPgql("SELECT x, x." + harmonic.getName() + "FROM MATCH (x) "); query.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
harmonicCentrality
public <ID> VertexProperty<ID,java.lang.Double> harmonicCentrality(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Harmonic centrality measures node importance by considering the reciprocal of the sum of shortest path distances in the network.
Definition
Harmonic centrality computes the centrality of each vertex by taking the reciprocal of the sum of the shortest path distances from that vertex to all other vertices in the graph. This metric highlights the importance of vertices that efficiently connect disparate parts of the network
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V * (V + E)) with V = number of vertices, E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Harmonic centrality can be applied in transportation networks to identify critical nodes that facilitate efficient travel between different destinations.
- Parameters:
graph
- the graph.- Returns:
- vertex property holding the harmonic centrality value for each vertex in the graph.
Examples
PgxGraph graph = ...; VertexProperty<Long, Double> harmonic = analyst.harmonicCentrality(graph); PgqlResultSet query = graph.queryPgql("SELECT x, x." + harmonic.getName() + "FROM MATCH (x) "); query.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
whomToFollow
public <ID> Pair<VertexSequence<ID>,VertexSequence<ID>> whomToFollow(PgxGraph graph, PgxVertex<ID> vertex) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
WTF is a recommendation algorithm. It returns two vertex sequences: one of similar users and a second one with users to follow.
Definition
The Whom To Follow algorithm is composed by two main stages: the first one is meant to get the relevant vertices (users) for a given source vertex (particular user), which in this implementation is done with personalized Pagerank for the given source vertex. While the second stage analyzes the relationships between the relevant vertices previously found through the edges linking them with their neighbors. This second stage relies on SALSA algorithm and it assigns a ranking score to all the hubs and authority vertices, so the recommendations can come from this assigned values. Whom To Follow takes the concept of authority and hub vertices, and adapts it to users in social networks. The hub vertices become similar users with respect to the given source vertex (also an user), and the authority vertices are translated into users that might be on the interest of the source vertex, i.e. users to follow.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * (p + s)) with E = number of edges, p <= maximum number of iterations for the Pagerank step, s <= maximum number of iterations for the SALSA step
- Space:
O(5 * V) with V = number of vertices
Default Values
Applications
- WTF was designed to find and recommend similar users (hub vertices) and potential users to follow (authority vertices) in social networks with directed edges in their structures.
- Parameters:
graph
- the graph.vertex
- the chosen vertex from the graph for personalization of the recommendations.- Returns:
- Pair holding the node sequences with the hub and authority recommendations.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); Pair<VertexSequence<Integer>, VertexSequence<Integer>> wtf = analyst.whomToFollow(graph, vertex); wtf.getFirst(); wtf.getSecond();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
whomToFollow
public <ID> Pair<VertexSequence<ID>,VertexSequence<ID>> whomToFollow(PgxGraph graph, PgxVertex<ID> vertex, int topK) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
WTF is a recommendation algorithm. It returns two vertex sequences: one of similar users and a second one with users to follow.
Definition
The Whom To Follow algorithm is composed by two main stages: the first one is meant to get the relevant vertices (users) for a given source vertex (particular user), which in this implementation is done with personalized Pagerank for the given source vertex. While the second stage analyzes the relationships between the relevant vertices previously found through the edges linking them with their neighbors. This second stage relies on SALSA algorithm and it assigns a ranking score to all the hubs and authority vertices, so the recommendations can come from this assigned values. Whom To Follow takes the concept of authority and hub vertices, and adapts it to users in social networks. The hub vertices become similar users with respect to the given source vertex (also an user), and the authority vertices are translated into users that might be on the interest of the source vertex, i.e. users to follow.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * (p + s)) with E = number of edges, p <= maximum number of iterations for the Pagerank step, s <= maximum number of iterations for the SALSA step
- Space:
O(5 * V) with V = number of vertices
Default Values
Applications
- WTF was designed to find and recommend similar users (hub vertices) and potential users to follow (authority vertices) in social networks with directed edges in their structures.
- Parameters:
graph
- the graph.vertex
- the chosen vertex from the graph for personalization of the recommendations.topK
- the maximum number of recommendations that will be returned. This number should be smaller than the size of the circle of trust.- Returns:
- Pair holding the node sequences with the hub and authority recommendations.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); Pair<VertexSequence<Integer>, VertexSequence<Integer>> wtf = analyst.whomToFollow(graph, vertex, 100); wtf.getFirst(); wtf.getSecond();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
whomToFollow
public <ID> Pair<VertexSequence<ID>,VertexSequence<ID>> whomToFollow(PgxGraph graph, PgxVertex<ID> vertex, int topK, int sizeCircleOfTrust) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
WTF is a recommendation algorithm. It returns two vertex sequences: one of similar users and a second one with users to follow.
Definition
The Whom To Follow algorithm is composed by two main stages: the first one is meant to get the relevant vertices (users) for a given source vertex (particular user), which in this implementation is done with personalized Pagerank for the given source vertex. While the second stage analyzes the relationships between the relevant vertices previously found through the edges linking them with their neighbors. This second stage relies on SALSA algorithm and it assigns a ranking score to all the hubs and authority vertices, so the recommendations can come from this assigned values. Whom To Follow takes the concept of authority and hub vertices, and adapts it to users in social networks. The hub vertices become similar users with respect to the given source vertex (also an user), and the authority vertices are translated into users that might be on the interest of the source vertex, i.e. users to follow.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * (p + s)) with E = number of edges, p <= maximum number of iterations for the Pagerank step, s <= maximum number of iterations for the SALSA step
- Space:
O(5 * V) with V = number of vertices
Default Values
Applications
- WTF was designed to find and recommend similar users (hub vertices) and potential users to follow (authority vertices) in social networks with directed edges in their structures.
- Parameters:
graph
- the graph.vertex
- the chosen vertex from the graph for personalization of the recommendations.topK
- the maximum number of recommendations that will be returned. This number should be smaller than the size of the circle of trust.sizeCircleOfTrust
- the maximum size of the circle of trust.- Returns:
- Pair holding the node sequences with the hub and authority recommendations.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); Pair<VertexSequence<Integer>, VertexSequence<Integer>> wtf = analyst.whomToFollow(graph, vertex, 100, 500); wtf.getFirst(); wtf.getSecond();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
whomToFollow
public <ID> Pair<VertexSequence<ID>,VertexSequence<ID>> whomToFollow(PgxGraph graph, PgxVertex<ID> vertex, VertexSequence<ID> hubs, VertexSequence<ID> authorities) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
WTF is a recommendation algorithm. It returns two vertex sequences: one of similar users and a second one with users to follow.
Definition
The Whom To Follow algorithm is composed by two main stages: the first one is meant to get the relevant vertices (users) for a given source vertex (particular user), which in this implementation is done with personalized Pagerank for the given source vertex. While the second stage analyzes the relationships between the relevant vertices previously found through the edges linking them with their neighbors. This second stage relies on SALSA algorithm and it assigns a ranking score to all the hubs and authority vertices, so the recommendations can come from this assigned values. Whom To Follow takes the concept of authority and hub vertices, and adapts it to users in social networks. The hub vertices become similar users with respect to the given source vertex (also an user), and the authority vertices are translated into users that might be on the interest of the source vertex, i.e. users to follow.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * (p + s)) with E = number of edges, p <= maximum number of iterations for the Pagerank step, s <= maximum number of iterations for the SALSA step
- Space:
O(5 * V) with V = number of vertices
Default Values
Applications
- WTF was designed to find and recommend similar users (hub vertices) and potential users to follow (authority vertices) in social networks with directed edges in their structures.
- Parameters:
graph
- the graph.vertex
- the chosen vertex from the graph for personalization of the recommendations.hubs
- (out argument) vertex sequence holding the top rated hub vertices (similar users) for the recommendations.authorities
- (out argument) vertex sequence holding the top rated authority vertices (users to follow) for the recommendations.- Returns:
- Pair holding the node sequences with the hub and authority recommendations.
Examples
PgxGraph graph = ...; VertexSequence<Integer> hubs = graph.createVertexSequence(); VertexSequence<Integer> auth = graph.createVertexSequence(); PgxVertex<Integer> vertex = graph.getVertex(128); Pair<VertexSequence<Integer>, VertexSequence<Integer>> wtf = analyst.whomToFollow(graph, vertex, hubs, auth); wtf.getFirst(); wtf.getSecond();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
whomToFollow
public <ID> Pair<VertexSequence<ID>,VertexSequence<ID>> whomToFollow(PgxGraph graph, PgxVertex<ID> vertex, int topK, VertexSequence<ID> hubs, VertexSequence<ID> authorities) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
WTF is a recommendation algorithm. It returns two vertex sequences: one of similar users and a second one with users to follow.
Definition
The Whom To Follow algorithm is composed by two main stages: the first one is meant to get the relevant vertices (users) for a given source vertex (particular user), which in this implementation is done with personalized Pagerank for the given source vertex. While the second stage analyzes the relationships between the relevant vertices previously found through the edges linking them with their neighbors. This second stage relies on SALSA algorithm and it assigns a ranking score to all the hubs and authority vertices, so the recommendations can come from this assigned values. Whom To Follow takes the concept of authority and hub vertices, and adapts it to users in social networks. The hub vertices become similar users with respect to the given source vertex (also an user), and the authority vertices are translated into users that might be on the interest of the source vertex, i.e. users to follow.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * (p + s)) with E = number of edges, p <= maximum number of iterations for the Pagerank step, s <= maximum number of iterations for the SALSA step
- Space:
O(5 * V) with V = number of vertices
Default Values
Applications
- WTF was designed to find and recommend similar users (hub vertices) and potential users to follow (authority vertices) in social networks with directed edges in their structures.
- Parameters:
graph
- the graph.vertex
- the chosen vertex from the graph for personalization of the recommendations.topK
- the maximum number of recommendations that will be returned. This number should be smaller than the size of the circle of trust.hubs
- (out argument) vertex sequence holding the top rated hub vertices (similar users) for the recommendations.authorities
- (out argument) vertex sequence holding the top rated authority vertices (users to follow) for the recommendations.- Returns:
- Pair holding the node sequences with the hub and authority recommendations.
Examples
PgxGraph graph = ...; VertexSequence<Integer> hubs = graph.createVertexSequence(); VertexSequence<Integer> auth = graph.createVertexSequence(); PgxVertex<Integer> vertex = graph.getVertex(128); Pair<VertexSequence<Integer>, VertexSequence<Integer>> wtf = analyst.whomToFollow(graph, vertex, 100, hubs, auth); wtf.getFirst(); wtf.getSecond();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
whomToFollow
public <ID> Pair<VertexSequence<ID>,VertexSequence<ID>> whomToFollow(PgxGraph graph, PgxVertex<ID> vertex, int topK, int sizeCircleOfTrust, VertexSequence<ID> hubs, VertexSequence<ID> authorities) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
WTF is a recommendation algorithm. It returns two vertex sequences: one of similar users and a second one with users to follow.
Definition
The Whom To Follow algorithm is composed by two main stages: the first one is meant to get the relevant vertices (users) for a given source vertex (particular user), which in this implementation is done with personalized Pagerank for the given source vertex. While the second stage analyzes the relationships between the relevant vertices previously found through the edges linking them with their neighbors. This second stage relies on SALSA algorithm and it assigns a ranking score to all the hubs and authority vertices, so the recommendations can come from this assigned values. Whom To Follow takes the concept of authority and hub vertices, and adapts it to users in social networks. The hub vertices become similar users with respect to the given source vertex (also an user), and the authority vertices are translated into users that might be on the interest of the source vertex, i.e. users to follow.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * (p + s)) with E = number of edges, p <= maximum number of iterations for the Pagerank step, s <= maximum number of iterations for the SALSA step
- Space:
O(5 * V) with V = number of vertices
Default Values
Applications
- WTF was designed to find and recommend similar users (hub vertices) and potential users to follow (authority vertices) in social networks with directed edges in their structures.
- Parameters:
graph
- the graph.vertex
- the chosen vertex from the graph for personalization of the recommendations.topK
- the maximum number of recommendations that will be returned. This number should be smaller than the size of the circle of trust.sizeCircleOfTrust
- the maximum size of the circle of trust.hubs
- (out argument) vertex sequence holding the top rated hub vertices (similar users) for the recommendations.authorities
- (out argument) vertex sequence holding the top rated authority vertices (users to follow) for the recommendations.- Returns:
- Pair holding the node sequences with the hub and authority recommendations.
Examples
PgxGraph graph = ...; VertexSequence<Integer> hubs = graph.createVertexSequence(); VertexSequence<Integer> auth = graph.createVertexSequence(); PgxVertex<Integer> vertex = graph.getVertex(128); Pair<VertexSequence<Integer>, VertexSequence<Integer>> wtf = analyst.whomToFollow(graph, vertex, 100, 500, hubs, auth); wtf.getFirst(); wtf.getSecond();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
whomToFollow
public <ID> Pair<VertexSequence<ID>,VertexSequence<ID>> whomToFollow(PgxGraph graph, PgxVertex<ID> vertex, int topK, int sizeCircleOfTrust, int maxIter, double tol, double dampingFactor, int salsaMaxIter, double salsaTol) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
WTF is a recommendation algorithm. It returns two vertex sequences: one of similar users and a second one with users to follow.
Definition
The Whom To Follow algorithm is composed by two main stages: the first one is meant to get the relevant vertices (users) for a given source vertex (particular user), which in this implementation is done with personalized Pagerank for the given source vertex. While the second stage analyzes the relationships between the relevant vertices previously found through the edges linking them with their neighbors. This second stage relies on SALSA algorithm and it assigns a ranking score to all the hubs and authority vertices, so the recommendations can come from this assigned values. Whom To Follow takes the concept of authority and hub vertices, and adapts it to users in social networks. The hub vertices become similar users with respect to the given source vertex (also an user), and the authority vertices are translated into users that might be on the interest of the source vertex, i.e. users to follow.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * (p + s)) with E = number of edges, p <= maximum number of iterations for the Pagerank step, s <= maximum number of iterations for the SALSA step
- Space:
O(5 * V) with V = number of vertices
Default Values
Applications
- WTF was designed to find and recommend similar users (hub vertices) and potential users to follow (authority vertices) in social networks with directed edges in their structures.
- Parameters:
graph
- the graph.vertex
- the chosen vertex from the graph for personalization of the recommendations.topK
- the maximum number of recommendations that will be returned. This number should be smaller than the size of the circle of trust.sizeCircleOfTrust
- the maximum size of the circle of trust.maxIter
- maximum number of iterations that will be performed for the Pagerank stage.tol
- maximum tolerated error value for the Pagerank stage. The stage will stop once the sum of the error values of all vertices becomes smaller than this value.dampingFactor
- damping factor for the Pagerank stage.salsaMaxIter
- maximum number of iterations that will be performed for the SALSA stage.salsaTol
- maximum tolerated error value for the SALSA stage. The stage will stop once the sum of the error values of all vertices becomes smaller than this value.hubs
- (out argument) vertex sequence holding the top rated hub vertices (similar users) for the recommendations.authorities
- (out argument) vertex sequence holding the top rated authority vertices (users to follow) for the recommendations.- Returns:
- Pair holding the node sequences with the hub and authority recommendations.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); Pair<VertexSequence<Integer>, VertexSequence<Integer>> wtf = analyst.whomToFollow(graph, vertex, 100, 500, 100, 0.001, 0.85, 100, 0.001); wtf.getFirst(); wtf.getSecond();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
whomToFollow
public <ID> Pair<VertexSequence<ID>,VertexSequence<ID>> whomToFollow(PgxGraph graph, PgxVertex<ID> vertex, int topK, int sizeCircleOfTrust, int maxIter, double tol, double dampingFactor, int salsaMaxIter, double salsaTol, VertexSequence<ID> hubs, VertexSequence<ID> authorities) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
WTF is a recommendation algorithm. It returns two vertex sequences: one of similar users and a second one with users to follow.
Definition
The Whom To Follow algorithm is composed by two main stages: the first one is meant to get the relevant vertices (users) for a given source vertex (particular user), which in this implementation is done with personalized Pagerank for the given source vertex. While the second stage analyzes the relationships between the relevant vertices previously found through the edges linking them with their neighbors. This second stage relies on SALSA algorithm and it assigns a ranking score to all the hubs and authority vertices, so the recommendations can come from this assigned values. Whom To Follow takes the concept of authority and hub vertices, and adapts it to users in social networks. The hub vertices become similar users with respect to the given source vertex (also an user), and the authority vertices are translated into users that might be on the interest of the source vertex, i.e. users to follow.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * (p + s)) with E = number of edges, p <= maximum number of iterations for the Pagerank step, s <= maximum number of iterations for the SALSA step
- Space:
O(5 * V) with V = number of vertices
Default Values
Applications
- WTF was designed to find and recommend similar users (hub vertices) and potential users to follow (authority vertices) in social networks with directed edges in their structures.
- Parameters:
graph
- the graph.vertex
- the chosen vertex from the graph for personalization of the recommendations.topK
- the maximum number of recommendations that will be returned. This number should be smaller than the size of the circle of trust.sizeCircleOfTrust
- the maximum size of the circle of trust.maxIter
- maximum number of iterations that will be performed for the Pagerank stage.tol
- maximum tolerated error value for the Pagerank stage. The stage will stop once the sum of the error values of all vertices becomes smaller than this value.dampingFactor
- damping factor for the Pagerank stage.salsaMaxIter
- maximum number of iterations that will be performed for the SALSA stage.salsaTol
- maximum tolerated error value for the SALSA stage. The stage will stop once the sum of the error values of all vertices becomes smaller than this value.hubs
- (out argument) vertex sequence holding the top rated hub vertices (similar users) for the recommendations.authorities
- (out argument) vertex sequence holding the top rated authority vertices (users to follow) for the recommendations.- Returns:
- Pair holding the node sequences with the hub and authority recommendations.
Examples
PgxGraph graph = ...; VertexSequence<Integer> hubs = graph.createVertexSequence(); VertexSequence<Integer> auth = graph.createVertexSequence(); PgxVertex<Integer> vertex = graph.getVertex(128); Pair<VertexSequence<Integer>, VertexSequence<Integer>> wtf = analyst.whomToFollow(graph, vertex, 100, 500, 100, 0.001, 0.85, 100, 0.001, hubs, auth); wtf.getFirst(); wtf.getSecond();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
salsa
public <ID> VertexProperty<ID,java.lang.Double> salsa(BipartiteGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
SALSA computes ranking scores. It assesses the quality of information and references in linked structures
Definition
The idea of hubs and authorities comes from the web pages: a hub is regarded as a page that is not authoritative in a specific matter, but it has instead links to authority pages, which are regarded as meaningful sources for a particular topic by many hubs. Thus a good hub will point to many authorities, while a good authority will be pointed by many hubs. SALSA is an algorithm that computes authorities and hubs ranking scores for the vertices using the network created by the edges of the [bipartite](prog-guides/mutation-subgraph/subgraph.html#create-a-bipartite-subgraph-based-on-a-vertex-list) graph and assigning weights to the contributions of their 2nd-degree neighbors. This way of computing the scores creates the independence between the authority and hub scores, which are assigned to the vertices depending on the side of the graph they belong (left:hub / right:aut).
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- SALSA was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- Bipartite graph.- Returns:
- vertex property holding the normalized authority/hub ranking score for each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> salsa = analyst.salsa(graph); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + salsa.getName() + " MATCH (x) ORDER BY x." + salsa.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
salsa
public <ID> VertexProperty<ID,java.lang.Double> salsa(BipartiteGraph graph, double maxDiff, int maxIter) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
SALSA computes ranking scores. It assesses the quality of information and references in linked structures
Definition
The idea of hubs and authorities comes from the web pages: a hub is regarded as a page that is not authoritative in a specific matter, but it has instead links to authority pages, which are regarded as meaningful sources for a particular topic by many hubs. Thus a good hub will point to many authorities, while a good authority will be pointed by many hubs. SALSA is an algorithm that computes authorities and hubs ranking scores for the vertices using the network created by the edges of the [bipartite](prog-guides/mutation-subgraph/subgraph.html#create-a-bipartite-subgraph-based-on-a-vertex-list) graph and assigning weights to the contributions of their 2nd-degree neighbors. This way of computing the scores creates the independence between the authority and hub scores, which are assigned to the vertices depending on the side of the graph they belong (left:hub / right:aut).
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- SALSA was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- Bipartite graph.maxDiff
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.maxIter
- maximum number of iterations that will be performed.- Returns:
- vertex property holding the normalized authority/hub ranking score for each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> salsa = analyst.salsa(graph, 0.001, 100); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + salsa.getName() + " MATCH (x) ORDER BY x." + salsa.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
salsa
public <ID> VertexProperty<ID,java.lang.Double> salsa(BipartiteGraph graph, double maxDiff, int maxIter, VertexProperty<ID,java.lang.Double> salsaRank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
SALSA computes ranking scores. It assesses the quality of information and references in linked structures
Definition
The idea of hubs and authorities comes from the web pages: a hub is regarded as a page that is not authoritative in a specific matter, but it has instead links to authority pages, which are regarded as meaningful sources for a particular topic by many hubs. Thus a good hub will point to many authorities, while a good authority will be pointed by many hubs. SALSA is an algorithm that computes authorities and hubs ranking scores for the vertices using the network created by the edges of the [bipartite](prog-guides/mutation-subgraph/subgraph.html#create-a-bipartite-subgraph-based-on-a-vertex-list) graph and assigning weights to the contributions of their 2nd-degree neighbors. This way of computing the scores creates the independence between the authority and hub scores, which are assigned to the vertices depending on the side of the graph they belong (left:hub / right:aut).
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- SALSA was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- Bipartite graph.maxDiff
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.maxIter
- maximum number of iterations that will be performed.salsaRank
- (out argument) vertex property holding the normalized authority/hub ranking score for each vertex.- Returns:
- vertex property holding the normalized authority/hub ranking score for each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> salsa = analyst.salsa(graph, 0.001, 100, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + salsa.getName() + " MATCH (x) ORDER BY x." + salsa.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
salsa
public <ID> VertexProperty<ID,java.lang.Double> salsa(BipartiteGraph graph, VertexProperty<ID,java.lang.Double> salsaRank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
SALSA computes ranking scores. It assesses the quality of information and references in linked structures
Definition
The idea of hubs and authorities comes from the web pages: a hub is regarded as a page that is not authoritative in a specific matter, but it has instead links to authority pages, which are regarded as meaningful sources for a particular topic by many hubs. Thus a good hub will point to many authorities, while a good authority will be pointed by many hubs. SALSA is an algorithm that computes authorities and hubs ranking scores for the vertices using the network created by the edges of the [bipartite](prog-guides/mutation-subgraph/subgraph.html#create-a-bipartite-subgraph-based-on-a-vertex-list) graph and assigning weights to the contributions of their 2nd-degree neighbors. This way of computing the scores creates the independence between the authority and hub scores, which are assigned to the vertices depending on the side of the graph they belong (left:hub / right:aut).
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- SALSA was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- Bipartite graph.salsaRank
- (out argument) vertex property holding the normalized authority/hub ranking score for each vertex.- Returns:
- vertex property holding the normalized authority/hub ranking score for each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> salsa = analyst.salsa(graph, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + salsa.getName() + " MATCH (x) ORDER BY x." + salsa.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
personalizedSalsa
public <ID> VertexProperty<ID,java.lang.Double> personalizedSalsa(BipartiteGraph graph, PgxVertex<ID> v) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized salsa for a vertex of interest. It assesses the quality of information and references in linked structures
Definition
This Personalized version of SALSA allows to select a particular vertex or set of vertices from the given graph in order to give them a greater importance when computing the ranking scores, which will have as result a personalized SALSA score and show relevant (or similar) vertices to the ones chosen for the personalization.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- SALSA was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- Bipartite graph.v
- the chosen vertex from the graph for personalization.- Returns:
- vertex property holding the normalized authority/hub ranking score for each vertex.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexProperty<Integer, Double> salsa = analyst.personalizedSalsa(graph, vertex); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + salsa.getName() + " MATCH (x) ORDER BY x." + salsa.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
personalizedSalsa
public <ID> VertexProperty<ID,java.lang.Double> personalizedSalsa(BipartiteGraph graph, PgxVertex<ID> v, double d, int maxIter, double maxDiff) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized salsa for a vertex of interest. It assesses the quality of information and references in linked structures
Definition
This Personalized version of SALSA allows to select a particular vertex or set of vertices from the given graph in order to give them a greater importance when computing the ranking scores, which will have as result a personalized SALSA score and show relevant (or similar) vertices to the ones chosen for the personalization.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- SALSA was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- Bipartite graph.v
- the chosen vertex from the graph for personalization.d
- damping factor to modulate the degree of personalization of the scores by the algorithm.maxIter
- maximum number of iterations that will be performed.maxDiff
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.- Returns:
- vertex property holding the normalized authority/hub ranking score for each vertex.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexProperty<Integer, Double> salsa = analyst.personalizedSalsa(graph, vertex, 0.85, 100, 0.001); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + salsa.getName() + " MATCH (x) ORDER BY x." + salsa.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
personalizedSalsa
public <ID> VertexProperty<ID,java.lang.Double> personalizedSalsa(BipartiteGraph graph, PgxVertex<ID> v, VertexProperty<ID,java.lang.Double> salsaRank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized salsa for a vertex of interest. It assesses the quality of information and references in linked structures
Definition
This Personalized version of SALSA allows to select a particular vertex or set of vertices from the given graph in order to give them a greater importance when computing the ranking scores, which will have as result a personalized SALSA score and show relevant (or similar) vertices to the ones chosen for the personalization.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- SALSA was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- Bipartite graph.v
- the chosen vertex from the graph for personalization.salsaRank
- (out argument) vertex property holding the normalized authority/hub ranking score for each vertex.- Returns:
- vertex property holding the normalized authority/hub ranking score for each vertex.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> salsa = analyst.personalizedSalsa(graph, vertex, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + salsa.getName() + " MATCH (x) ORDER BY x." + salsa.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
personalizedSalsa
public <ID> VertexProperty<ID,java.lang.Double> personalizedSalsa(BipartiteGraph graph, PgxVertex<ID> v, double d, int maxIter, double maxDiff, VertexProperty<ID,java.lang.Double> salsaRank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized salsa for a vertex of interest. It assesses the quality of information and references in linked structures
Definition
This Personalized version of SALSA allows to select a particular vertex or set of vertices from the given graph in order to give them a greater importance when computing the ranking scores, which will have as result a personalized SALSA score and show relevant (or similar) vertices to the ones chosen for the personalization.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- SALSA was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- Bipartite graph.v
- the chosen vertex from the graph for personalization.d
- damping factor to modulate the degree of personalization of the scores by the algorithm.maxIter
- maximum number of iterations that will be performed.maxDiff
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.salsaRank
- (out argument) vertex property holding the normalized authority/hub ranking score for each vertex.- Returns:
- vertex property holding the normalized authority/hub ranking score for each vertex.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> salsa = analyst.personalizedSalsa(graph, vertex, 0.85, 100, 0.001, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + salsa.getName() + " MATCH (x) ORDER BY x." + salsa.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
personalizedSalsa
public <ID> VertexProperty<ID,java.lang.Double> personalizedSalsa(BipartiteGraph graph, VertexSet<ID> vertices) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized salsa for a set of vertices of interest. It assesses the quality of information and references in linked structures
Definition
This Personalized version of SALSA allows to select a particular vertex or set of vertices from the given graph in order to give them a greater importance when computing the ranking scores, which will have as result a personalized SALSA score and show relevant (or similar) vertices to the ones chosen for the personalization.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- SALSA was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- Bipartite graph.vertices
- the set of chosen vertices from the graph for personalization.- Returns:
- vertex property holding the normalized authority/hub ranking score for each vertex.
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); VertexProperty<Integer, Double> salsa = analyst.personalizedSalsa(graph, vertices); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + salsa.getName() + " MATCH (x) ORDER BY x." + salsa.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
personalizedSalsa
public <ID> VertexProperty<ID,java.lang.Double> personalizedSalsa(BipartiteGraph graph, VertexSet<ID> vertices, VertexProperty<ID,java.lang.Double> salsaRank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized salsa for a set of vertices of interest. It assesses the quality of information and references in linked structures
Definition
This Personalized version of SALSA allows to select a particular vertex or set of vertices from the given graph in order to give them a greater importance when computing the ranking scores, which will have as result a personalized SALSA score and show relevant (or similar) vertices to the ones chosen for the personalization.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- SALSA was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- Bipartite graph.vertices
- the set of chosen vertices from the graph for personalization.salsaRank
- (out argument) vertex property holding the normalized authority/hub ranking score for each vertex.- Returns:
- vertex property holding the normalized authority/hub ranking score for each vertex.
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> salsa = analyst.personalizedSalsa(graph, vertices, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + salsa.getName() + " MATCH (x) ORDER BY x." + salsa.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
personalizedSalsa
public <ID> VertexProperty<ID,java.lang.Double> personalizedSalsa(BipartiteGraph graph, VertexSet<ID> vertices, double d, int maxIter, double maxDiff) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized salsa for a set of vertices of interest. It assesses the quality of information and references in linked structures
Definition
This Personalized version of SALSA allows to select a particular vertex or set of vertices from the given graph in order to give them a greater importance when computing the ranking scores, which will have as result a personalized SALSA score and show relevant (or similar) vertices to the ones chosen for the personalization.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- SALSA was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- Bipartite graph.vertices
- the set of chosen vertices from the graph for personalization.d
- damping factor to modulate the degree of personalization of the scores by the algorithm.maxIter
- maximum number of iterations that will be performed.maxDiff
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.- Returns:
- vertex property holding the normalized authority/hub ranking score for each vertex.
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); VertexProperty<Integer, Double> salsa = analyst.personalizedSalsa(graph, vertices, 0.85, 100, 0.001); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + salsa.getName() + " MATCH (x) ORDER BY x." + salsa.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
personalizedSalsa
public <ID> VertexProperty<ID,java.lang.Double> personalizedSalsa(BipartiteGraph graph, VertexSet<ID> vertices, double d, int maxIter, double maxDiff, VertexProperty<ID,java.lang.Double> salsaRank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Personalized salsa for a set of vertices of interest. It assesses the quality of information and references in linked structures
Definition
This Personalized version of SALSA allows to select a particular vertex or set of vertices from the given graph in order to give them a greater importance when computing the ranking scores, which will have as result a personalized SALSA score and show relevant (or similar) vertices to the ones chosen for the personalization.
Implementation Details
The implementation of this algorithm uses an iterative method. It will converge once it reaches the error tolerance criteria or the maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- SALSA was designed to rate web pages given the links existing between them. It uses the authority of a page (vertex) to asses the quality of the information it has, while the hub score do so for the quality of the links to other pages (vertices).
- Parameters:
graph
- Bipartite graph.vertices
- the set of chosen vertices from the graph for personalization.d
- damping factor to modulate the degree of personalization of the scores by the algorithm.maxIter
- maximum number of iterations that will be performed.maxDiff
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.salsaRank
- (out argument) vertex property holding the normalized authority/hub ranking score for each vertex.- Returns:
- vertex property holding the normalized authority/hub ranking score for each vertex.
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.getVertices(VertexFilter.fromExpression("vertex.prop1 < 10")); VertexProperty<Integer, Double> rank = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> salsa = analyst.personalizedSalsa(graph, vertices, 0.85, 100, 0.001, rank); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + salsa.getName() + " MATCH (x) ORDER BY x." + salsa.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
communitiesConductanceMinimization
public <ID> Partition<ID> communitiesConductanceMinimization(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Soman and Narang can find communities in a graph taking weighted edges into account
Definition
The algorithm proposed by Soman and Narang to find community structures in a graph can be regarded as a variant of the label propagation algorithm, since it takes into account weights over the edges when looking for the community assignments. This implementation generates the weight of the edges by using the triangles in the graph, and just like label propagation, it assigns a unique community label to each vertex in the graph at the beginning, which is then updated on each iteration by looking and choosing the most frequent label from the labels of their neighbors. Convergence is achieved once the label of each vertex is the same as the most frequent one amongst its neighbors, i.e. when there are no changes in the communities assigned to the vertices in one iteration.
Implementation Details
The implementation of this algorithm uses an iterative method. Since the algorithm visits the vertices in a random order on each iteration it is non-deterministic. Also note that there is a possibility of constant vertex swapping. For example, if you have two vertices A and B in your graph. It can happen that A will acquire the community of B but at the same time B will acquire the community of A. That is why you should set a maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(5 * V + 2 * E) with V = number of vertices, E = number of edges
Default Values
- max_iter: 100
Applications
- Community detection can be used for clustering and can be applied to the analysis of organization in real-world scenarios like groups of people in social networks.
- Parameters:
graph
- the graph.- Returns:
- Partition holding the node collections corresponding to the communities found by the algorithm.
Examples
PgxGraph graph = ...; Partition<Integer> conductance = analyst.communitiesConductanceMinimization(graph); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + conductance.getPropertyName() + " MATCH (x) ORDER BY x." + conductance.getPropertyName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
communitiesConductanceMinimization
public <ID> Partition<ID> communitiesConductanceMinimization(PgxGraph graph, int maxIterations) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Soman and Narang can find communities in a graph taking weighted edges into account
Definition
The algorithm proposed by Soman and Narang to find community structures in a graph can be regarded as a variant of the label propagation algorithm, since it takes into account weights over the edges when looking for the community assignments. This implementation generates the weight of the edges by using the triangles in the graph, and just like label propagation, it assigns a unique community label to each vertex in the graph at the beginning, which is then updated on each iteration by looking and choosing the most frequent label from the labels of their neighbors. Convergence is achieved once the label of each vertex is the same as the most frequent one amongst its neighbors, i.e. when there are no changes in the communities assigned to the vertices in one iteration.
Implementation Details
The implementation of this algorithm uses an iterative method. Since the algorithm visits the vertices in a random order on each iteration it is non-deterministic. Also note that there is a possibility of constant vertex swapping. For example, if you have two vertices A and B in your graph. It can happen that A will acquire the community of B but at the same time B will acquire the community of A. That is why you should set a maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(5 * V + 2 * E) with V = number of vertices, E = number of edges
Default Values
- max_iter: 100
Applications
- Community detection can be used for clustering and can be applied to the analysis of organization in real-world scenarios like groups of people in social networks.
- Parameters:
graph
- the graph.maxIterations
- maximum number of iterations that will be performed. For most graphs, a maximum of 100 iterations should be enough.- Returns:
- Partition holding the node collections corresponding to the communities found by the algorithm.
Examples
PgxGraph graph = ...; Partition<Integer> conductance = analyst.communitiesConductanceMinimization(graph, 100); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + conductance.getPropertyName() + " MATCH (x) ORDER BY x." + conductance.getPropertyName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
communitiesConductanceMinimization
public <ID> Partition<ID> communitiesConductanceMinimization(PgxGraph graph, VertexProperty<ID,java.lang.Long> partitionDistribution) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Soman and Narang can find communities in a graph taking weighted edges into account
Definition
The algorithm proposed by Soman and Narang to find community structures in a graph can be regarded as a variant of the label propagation algorithm, since it takes into account weights over the edges when looking for the community assignments. This implementation generates the weight of the edges by using the triangles in the graph, and just like label propagation, it assigns a unique community label to each vertex in the graph at the beginning, which is then updated on each iteration by looking and choosing the most frequent label from the labels of their neighbors. Convergence is achieved once the label of each vertex is the same as the most frequent one amongst its neighbors, i.e. when there are no changes in the communities assigned to the vertices in one iteration.
Implementation Details
The implementation of this algorithm uses an iterative method. Since the algorithm visits the vertices in a random order on each iteration it is non-deterministic. Also note that there is a possibility of constant vertex swapping. For example, if you have two vertices A and B in your graph. It can happen that A will acquire the community of B but at the same time B will acquire the community of A. That is why you should set a maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(5 * V + 2 * E) with V = number of vertices, E = number of edges
Default Values
- max_iter: 100
Applications
- Community detection can be used for clustering and can be applied to the analysis of organization in real-world scenarios like groups of people in social networks.
- Parameters:
graph
- the graph.partitionDistribution
- vertex property holding the label of the community assigned to each vertex.- Returns:
- Partition holding the node collections corresponding to the communities found by the algorithm.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Long> pd = graph.createVertexProperty(PropertyType.LONG); Partition<Integer> conductance = analyst.communitiesConductanceMinimization(graph, pd); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + conductance.getPropertyName() + " MATCH (x) ORDER BY x." + conductance.getPropertyName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
communitiesConductanceMinimization
public <ID> Partition<ID> communitiesConductanceMinimization(PgxGraph graph, int maxIterations, VertexProperty<ID,java.lang.Long> partitionDistribution) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Soman and Narang can find communities in a graph taking weighted edges into account
Definition
The algorithm proposed by Soman and Narang to find community structures in a graph can be regarded as a variant of the label propagation algorithm, since it takes into account weights over the edges when looking for the community assignments. This implementation generates the weight of the edges by using the triangles in the graph, and just like label propagation, it assigns a unique community label to each vertex in the graph at the beginning, which is then updated on each iteration by looking and choosing the most frequent label from the labels of their neighbors. Convergence is achieved once the label of each vertex is the same as the most frequent one amongst its neighbors, i.e. when there are no changes in the communities assigned to the vertices in one iteration.
Implementation Details
The implementation of this algorithm uses an iterative method. Since the algorithm visits the vertices in a random order on each iteration it is non-deterministic. Also note that there is a possibility of constant vertex swapping. For example, if you have two vertices A and B in your graph. It can happen that A will acquire the community of B but at the same time B will acquire the community of A. That is why you should set a maximum number of iterations.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(5 * V + 2 * E) with V = number of vertices, E = number of edges
Default Values
- max_iter: 100
Applications
- Community detection can be used for clustering and can be applied to the analysis of organization in real-world scenarios like groups of people in social networks.
- Parameters:
graph
- the graph.maxIterations
- maximum number of iterations that will be performed. For most graphs, a maximum of 100 iterations should be enough.partitionDistribution
- vertex property holding the label of the community assigned to each vertex.- Returns:
- Partition holding the node collections corresponding to the communities found by the algorithm.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Long> pd = graph.createVertexProperty(PropertyType.LONG); Partition<Integer> conductance = analyst.communitiesConductanceMinimization(graph, 100, pd); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + conductance.getPropertyName() + " MATCH (x) ORDER BY x." + conductance.getPropertyName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
communitiesLabelPropagation
public <ID> Partition<ID> communitiesLabelPropagation(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Label propagation can find communities in a graph relatively fast
Definition
Label Propagation is an algorithm designed to find community structures in a graph. It assigns a unique community label to each vertex in the graph, which then is updated on each iteration by looking and choosing the most frequent label amongst those from its neighbors. Convergence is achieved once the label of each vertex is the same as the most frequent one amongst its neighbors, i.e. when there are no changes in the communities assigned to the vertices in one iteration.
Implementation Details
The implementation of this algorithm uses an iterative method. Since the algorithm visits the vertices in a random order on each iteration it is non-deterministic.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
- max_iter: 100
Applications
- Community detection can be used for clustering and can be applied to the analysis of organization in real-world scenarios like groups of people in social networks.
- Parameters:
graph
- the graph.- Returns:
- Partition holding the node collections corresponding to the communities found by the algorithm.
Examples
PgxGraph graph = ...; Partition<Integer> conductance = analyst.communitiesLabelPropagation(graph); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + conductance.getPropertyName() + " MATCH (x) ORDER BY x." + conductance.getPropertyName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
communitiesLabelPropagation
public <ID> Partition<ID> communitiesLabelPropagation(PgxGraph graph, int maxIterations) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Label propagation can find communities in a graph relatively fast
Definition
Label Propagation is an algorithm designed to find community structures in a graph. It assigns a unique community label to each vertex in the graph, which then is updated on each iteration by looking and choosing the most frequent label amongst those from its neighbors. Convergence is achieved once the label of each vertex is the same as the most frequent one amongst its neighbors, i.e. when there are no changes in the communities assigned to the vertices in one iteration.
Implementation Details
The implementation of this algorithm uses an iterative method. Since the algorithm visits the vertices in a random order on each iteration it is non-deterministic.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
- max_iter: 100
Applications
- Community detection can be used for clustering and can be applied to the analysis of organization in real-world scenarios like groups of people in social networks.
- Parameters:
graph
- the graph.maxIterations
- maximum number of iterations that will be performed.- Returns:
- Partition holding the node collections corresponding to the communities found by the algorithm.
Examples
PgxGraph graph = ...; Partition<Integer> conductance = analyst.communitiesLabelPropagation(graph, 100); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + conductance.getPropertyName() + " MATCH (x) ORDER BY x." + conductance.getPropertyName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
communitiesLabelPropagation
public <ID> Partition<ID> communitiesLabelPropagation(PgxGraph graph, int maxIterations, VertexProperty<ID,java.lang.Long> partitionDistribution) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Label propagation can find communities in a graph relatively fast
Definition
Label Propagation is an algorithm designed to find community structures in a graph. It assigns a unique community label to each vertex in the graph, which then is updated on each iteration by looking and choosing the most frequent label amongst those from its neighbors. Convergence is achieved once the label of each vertex is the same as the most frequent one amongst its neighbors, i.e. when there are no changes in the communities assigned to the vertices in one iteration.
Implementation Details
The implementation of this algorithm uses an iterative method. Since the algorithm visits the vertices in a random order on each iteration it is non-deterministic.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
- max_iter: 100
Applications
- Community detection can be used for clustering and can be applied to the analysis of organization in real-world scenarios like groups of people in social networks.
- Parameters:
graph
- the graph.maxIterations
- maximum number of iterations that will be performed.partitionDistribution
- vertex property holding the label of the community assigned to each vertex.- Returns:
- Partition holding the node collections corresponding to the communities found by the algorithm.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Long> pd = graph.createVertexProperty(PropertyType.LONG); Partition<Integer> conductance = analyst.communitiesLabelPropagation(graph, 100, pd); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + conductance.getPropertyName() + " MATCH (x) ORDER BY x." + conductance.getPropertyName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
communitiesLabelPropagation
public <ID> Partition<ID> communitiesLabelPropagation(PgxGraph graph, VertexProperty<ID,java.lang.Long> partitonDistribution) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Label propagation can find communities in a graph relatively fast
Definition
Label Propagation is an algorithm designed to find community structures in a graph. It assigns a unique community label to each vertex in the graph, which then is updated on each iteration by looking and choosing the most frequent label amongst those from its neighbors. Convergence is achieved once the label of each vertex is the same as the most frequent one amongst its neighbors, i.e. when there are no changes in the communities assigned to the vertices in one iteration.
Implementation Details
The implementation of this algorithm uses an iterative method. Since the algorithm visits the vertices in a random order on each iteration it is non-deterministic.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(2 * V) with V = number of vertices
Default Values
- max_iter: 100
Applications
- Community detection can be used for clustering and can be applied to the analysis of organization in real-world scenarios like groups of people in social networks.
- Parameters:
graph
- the graph.partitonDistribution
- vertex property holding the label of the community assigned to each vertex.- Returns:
- Partition holding the node collections corresponding to the communities found by the algorithm.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Long> pd = graph.createVertexProperty(PropertyType.LONG); Partition<Integer> conductance = analyst.communitiesLabelPropagation(graph, pd); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + conductance.getPropertyName() + " MATCH (x) ORDER BY x." + conductance.getPropertyName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
communitiesInfomap
public <ID> Partition<ID> communitiesInfomap(PgxGraph graph, VertexProperty<ID,java.lang.Double> rank, EdgeProperty<java.lang.Double> weight) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Infomap can find high quality communities in a graph.
Definition
Infomap is a robust algorithm designed to find community structures in a graph that requires some pre-processing steps. This implementation needs a reciprocated or an undirected graph, as well as the ranking score from the normalized weighted version of the Pagerank algorithm. It will assign a unique module (or community) label to each vertex in the graph based on their Pagerank score, edge weights and the labels of their neighbors. It is an iterative algorithm that updates the labels of the vertices in random order on each iteration using the previous factors, converging once there are no further changes in the vertex labels, or once the maximum number of iterations is reached. The algorithm is non-deterministic because of the random order for visiting and updating the vertex labels, thus the communities found might be different each time the algorithm is run.
Implementation Details
The implementation of this algorithm uses an iterative method. Since the algorithm visits the vertices in a random order on each iteration it is non-deterministic. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O((k ^ 2) * E) with E = number of edges, k <= maximum number of iterations
- Space:
O(10 * V + 2 * E) with V = number of vertices, E = number of edges
Default Values
- max_iter: 100
Applications
- Community detection can be used for clustering and can be applied to the analysis of organization in real-world scenarios like groups of people in social networks.
- Parameters:
graph
- the undirected graph.rank
- vertex property holding the normalized (weighted) PageRank value for each vertex (a value between 0 and 1).weight
- edge property holding the weight of each edge in the graph.- Returns:
- Partition holding the node collections corresponding to the communities found by the algorithm.
Examples
PgxGraph graph = ...; EdgeProperty<Double> weight = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> rank = analyst.weightedPagerank(graph, 1e-16, 0.85, 1000, true, weight); VertexProperty<Integer, Long> module = graph.createVertexProperty(PropertyType.LONG); Partition<Integer> promise = analyst.communitiesInfomap(graph, rank, weight); first_component = promise.getPartitionByIndex(0)
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
communitiesInfomap
public <ID> Partition<ID> communitiesInfomap(PgxGraph graph, VertexProperty<ID,java.lang.Double> rank, EdgeProperty<java.lang.Double> weight, double tau, double tol, int maxIter) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Infomap can find high quality communities in a graph.
Definition
Infomap is a robust algorithm designed to find community structures in a graph that requires some pre-processing steps. This implementation needs a reciprocated or an undirected graph, as well as the ranking score from the normalized weighted version of the Pagerank algorithm. It will assign a unique module (or community) label to each vertex in the graph based on their Pagerank score, edge weights and the labels of their neighbors. It is an iterative algorithm that updates the labels of the vertices in random order on each iteration using the previous factors, converging once there are no further changes in the vertex labels, or once the maximum number of iterations is reached. The algorithm is non-deterministic because of the random order for visiting and updating the vertex labels, thus the communities found might be different each time the algorithm is run.
Implementation Details
The implementation of this algorithm uses an iterative method. Since the algorithm visits the vertices in a random order on each iteration it is non-deterministic. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O((k ^ 2) * E) with E = number of edges, k <= maximum number of iterations
- Space:
O(10 * V + 2 * E) with V = number of vertices, E = number of edges
Default Values
- max_iter: 100
Applications
- Community detection can be used for clustering and can be applied to the analysis of organization in real-world scenarios like groups of people in social networks.
- Parameters:
graph
- the undirected graph.rank
- vertex property holding the normalized (weighted) PageRank value for each vertex (a value between 0 and 1).weight
- edge property holding the weight of each edge in the graph.tau
- damping factor.tol
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.maxIter
- maximum number of iterations that will be performed.- Returns:
- Partition holding the node collections corresponding to the communities found by the algorithm.
Examples
PgxGraph graph = ...; EdgeProperty<Double> weight = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> rank = analyst.weightedPagerank(graph, 1e-16, 0.85, 1000, true, weight); VertexProperty<Integer, Long> module = graph.createVertexProperty(PropertyType.LONG); Partition<Integer> promise = analyst.communitiesInfomap(graph, rank, weight, 0.15, 0.0001, 10); first_component = promise.getPartitionByIndex(0)
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
communitiesInfomap
public <ID> Partition<ID> communitiesInfomap(PgxGraph graph, VertexProperty<ID,java.lang.Double> rank, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Long> module) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Infomap can find high quality communities in a graph.
Definition
Infomap is a robust algorithm designed to find community structures in a graph that requires some pre-processing steps. This implementation needs a reciprocated or an undirected graph, as well as the ranking score from the normalized weighted version of the Pagerank algorithm. It will assign a unique module (or community) label to each vertex in the graph based on their Pagerank score, edge weights and the labels of their neighbors. It is an iterative algorithm that updates the labels of the vertices in random order on each iteration using the previous factors, converging once there are no further changes in the vertex labels, or once the maximum number of iterations is reached. The algorithm is non-deterministic because of the random order for visiting and updating the vertex labels, thus the communities found might be different each time the algorithm is run.
Implementation Details
The implementation of this algorithm uses an iterative method. Since the algorithm visits the vertices in a random order on each iteration it is non-deterministic. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O((k ^ 2) * E) with E = number of edges, k <= maximum number of iterations
- Space:
O(10 * V + 2 * E) with V = number of vertices, E = number of edges
Default Values
- max_iter: 100
Applications
- Community detection can be used for clustering and can be applied to the analysis of organization in real-world scenarios like groups of people in social networks.
- Parameters:
graph
- the undirected graph.rank
- vertex property holding the normalized (weighted) PageRank value for each vertex (a value between 0 and 1).weight
- edge property holding the weight of each edge in the graph.module
- vertex property holding the label of the community assigned to each vertex.- Returns:
- Partition holding the node collections corresponding to the communities found by the algorithm.
Examples
PgxGraph graph = ...; EdgeProperty<Double> weight = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> rank = analyst.weightedPagerank(graph, 1e-16, 0.85, 1000, true, weight); VertexProperty<Integer, Long> module = graph.createVertexProperty(PropertyType.LONG); Partition<Integer> promise = analyst.communitiesInfomap(graph, rank, weight, module); first_component = promise.getPartitionByIndex(0)
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
communitiesInfomap
public <ID> Partition<ID> communitiesInfomap(PgxGraph graph, VertexProperty<ID,java.lang.Double> rank, EdgeProperty<java.lang.Double> weight, double tau, double tol, int maxIter, VertexProperty<ID,java.lang.Long> module) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Infomap can find high quality communities in a graph.
Definition
Infomap is a robust algorithm designed to find community structures in a graph that requires some pre-processing steps. This implementation needs a reciprocated or an undirected graph, as well as the ranking score from the normalized weighted version of the Pagerank algorithm. It will assign a unique module (or community) label to each vertex in the graph based on their Pagerank score, edge weights and the labels of their neighbors. It is an iterative algorithm that updates the labels of the vertices in random order on each iteration using the previous factors, converging once there are no further changes in the vertex labels, or once the maximum number of iterations is reached. The algorithm is non-deterministic because of the random order for visiting and updating the vertex labels, thus the communities found might be different each time the algorithm is run.
Implementation Details
The implementation of this algorithm uses an iterative method. Since the algorithm visits the vertices in a random order on each iteration it is non-deterministic. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O((k ^ 2) * E) with E = number of edges, k <= maximum number of iterations
- Space:
O(10 * V + 2 * E) with V = number of vertices, E = number of edges
Default Values
- max_iter: 100
Applications
- Community detection can be used for clustering and can be applied to the analysis of organization in real-world scenarios like groups of people in social networks.
- Parameters:
graph
- the undirected graph.rank
- vertex property holding the normalized (weighted) PageRank value for each vertex (a value between 0 and 1).weight
- edge property holding the weight of each edge in the graph.tau
- damping factor.tol
- maximum tolerated error value. The algorithm will stop once the sum of the error values of all vertices becomes smaller than this value.maxIter
- maximum number of iterations that will be performed.module
- vertex property holding the label of the community assigned to each vertex.- Returns:
- Partition holding the node collections corresponding to the communities found by the algorithm.
Examples
PgxGraph graph = ...; EdgeProperty<Double> weight = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> rank = analyst.weightedPagerank(graph, 1e-16, 0.85, 1000, true, weight); VertexProperty<Integer, Long> module = graph.createVertexProperty(PropertyType.LONG); Partition<Integer> promise = analyst.communitiesInfomap(graph, rank, weight, 0.15, 0.0001, 10, module); first_component = promise.getPartitionByIndex(0)
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
louvain
public <ID> VertexProperty<ID,java.lang.Long> louvain(PgxGraph graph, EdgeProperty<java.lang.Double> weight, int maxIter, int nbrPass, double tol, VertexProperty<ID,java.lang.Long> community) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Louvain can detect communities in a large graph relatively fast.
Definition
Louvain is an algorithm for community detection in large graphs which uses the graph's modularity. Initially it assigns a different community to each node of the graph. It then iterates over the nodes and evaluates for each node the modularity gain obtained by removing the node from its community and placing it in the community of one of its neighbors. The node is placed in the community for which the modularity gain is maximum. This process is repeated for all nodes until no improvement is possible, i.e until no new assignment of a node to a different community can improve the graph's modularity.
Implementation Details
The implementation of this algorithm uses an iterative method.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(8 * V + E) with V = number of vertices
Default Values
Applications
- The Louvain algorithm can be used for community detection in a multiple real-life situations, like identifying cyber-communities in a social network.
- Parameters:
graph
- the graph.weight
- weights of the edges of the graph.maxIter
- maximum number of iterations that will be performed during each pass.nbrPass
- number of passes that will be performed.tol
- maximum tolerated error value. The algorithm will stop once the graph's total modularity gain becomes smaller than this value.community
- the community ID assigned to each node.- Returns:
- the community ID assigned to each node.
Examples
PgxGraph graph = ...; EdgeProperty<Double> weight = graph.getEdgeProperty("cost"); VertexProperty<Long, Long> community = graph.createVertexProperty(PropertyType.LONG,"COMMUNITY"); var result = analyst.louvain(graph, weight, 100, 10, 0.001, community);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
louvain
public <ID> VertexProperty<ID,java.lang.Long> louvain(PgxGraph graph, EdgeProperty<java.lang.Double> weight, int maxIter) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Louvain can detect communities in a large graph relatively fast.
Definition
Louvain is an algorithm for community detection in large graphs which uses the graph's modularity. Initially it assigns a different community to each node of the graph. It then iterates over the nodes and evaluates for each node the modularity gain obtained by removing the node from its community and placing it in the community of one of its neighbors. The node is placed in the community for which the modularity gain is maximum. This process is repeated for all nodes until no improvement is possible, i.e until no new assignment of a node to a different community can improve the graph's modularity.
Implementation Details
The implementation of this algorithm uses an iterative method.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(8 * V + E) with V = number of vertices
Default Values
Applications
- The Louvain algorithm can be used for community detection in a multiple real-life situations, like identifying cyber-communities in a social network.
- Parameters:
graph
- the graph.weight
- weights of the edges of the graph.maxIter
- maximum number of iterations that will be performed during each pass.- Returns:
- the community ID assigned to each node.
Examples
PgxGraph graph = ...; EdgeProperty<Double> weight = graph.getEdgeProperty("cost"); VertexProperty<Long, Long> community = analyst.louvain(graph, weight, 100);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
louvain
public <ID> VertexProperty<ID,java.lang.Long> louvain(PgxGraph graph, EdgeProperty<java.lang.Double> weight) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Louvain can detect communities in a large graph relatively fast.
Definition
Louvain is an algorithm for community detection in large graphs which uses the graph's modularity. Initially it assigns a different community to each node of the graph. It then iterates over the nodes and evaluates for each node the modularity gain obtained by removing the node from its community and placing it in the community of one of its neighbors. The node is placed in the community for which the modularity gain is maximum. This process is repeated for all nodes until no improvement is possible, i.e until no new assignment of a node to a different community can improve the graph's modularity.
Implementation Details
The implementation of this algorithm uses an iterative method.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(8 * V + E) with V = number of vertices
Default Values
Applications
- The Louvain algorithm can be used for community detection in a multiple real-life situations, like identifying cyber-communities in a social network.
- Parameters:
graph
- the graph.weight
- weights of the edges of the graph.- Returns:
- the community ID assigned to each node.
Examples
PgxGraph graph = ...; EdgeProperty<Double> weight = graph.getEdgeProperty("cost"); VertexProperty<Long, Long> community = analyst.louvain(graph, weight);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
speakerListenerLabelPropagation
public <ID> VertexProperty<ID,java.lang.String> speakerListenerLabelPropagation(PgxGraph graph, java.lang.String labelsPropName) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.
Definition
The speaker listener label propagation algorithm is an extension of the label propagation algorithm, which is able to detect overlapping communities.
Implementation Details
null
Complexity
- Time:
O(max_iter * N) with N = number of neighbors of vertex1, max_iter = number of iterations
- Space:
O(N + V * max_iter) with N = number of neighbors of vertex1, max_iter = number of iterations
Default Values
- max_iter: 100
- threshold: 0.0
- delimiter: |
Applications
- Parameters:
graph
- the graph.labelsPropName
- The name of the string property.- Returns:
- distinct vertex labels which meet the threshold parameter.
Examples
PgxGraph graph = ...; String labelsPropname="O___"; VertexProperty<ID, String> labels = analyst.speakerListenerLabelPropagation(graph, labelsPropName);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
speakerListenerLabelPropagation
public <ID> VertexProperty<ID,java.lang.String> speakerListenerLabelPropagation(PgxGraph graph, java.lang.String labelsPropName, int maxIter, double threshold, java.lang.String delimiter) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.
Definition
The speaker listener label propagation algorithm is an extension of the label propagation algorithm, which is able to detect overlapping communities.
Implementation Details
null
Complexity
- Time:
O(max_iter * N) with N = number of neighbors of vertex1, max_iter = number of iterations
- Space:
O(N + V * max_iter) with N = number of neighbors of vertex1, max_iter = number of iterations
Default Values
- max_iter: 100
- threshold: 0.0
- delimiter: |
Applications
- Parameters:
graph
- the graph.labelsPropName
- The name of the string property.maxIter
- number of iterations.threshold
- minimum frequency for a label to retain a vertex.delimiter
- string delimiter for labels.- Returns:
- distinct vertex labels which meet the threshold parameter.
Examples
PgxGraph graph = ...; String labelsPropname="O___"; int maxIter = 100; double threshold = 0.2; String delimiter = "|"; VertexProperty<ID, String> labels = analyst.speakerListenerLabelPropagation(graph, labelsPropName, maxIter, threshold, delimiter);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
speakerListenerLabelPropagation
public <ID> VertexProperty<ID,java.lang.String> speakerListenerLabelPropagation(PgxGraph graph, VertexProperty<ID,java.lang.String> labels, int maxIter, double threshold, java.lang.String delimiter) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.
Definition
The speaker listener label propagation algorithm is an extension of the label propagation algorithm, which is able to detect overlapping communities.
Implementation Details
null
Complexity
- Time:
O(max_iter * N) with N = number of neighbors of vertex1, max_iter = number of iterations
- Space:
O(N + V * max_iter) with N = number of neighbors of vertex1, max_iter = number of iterations
Default Values
- max_iter: 100
- threshold: 0.0
- delimiter: |
Applications
- Parameters:
graph
- the graph.labels
- distinct vertex labels which meet the threshold parameter.maxIter
- number of iterations.threshold
- minimum frequency for a label to retain a vertex.delimiter
- string delimiter for labels.- Returns:
- distinct vertex labels which meet the threshold parameter.
Examples
PgxGraph graph = ...; VertexProperty<ID, String> labels = graph.createVertexProperty(PropertyType.STRING); int maxIter = 100; double threshold = 0.2; String delimiter = "|"; VertexProperty<ID, String> labels = analyst.speakerListenerLabelPropagation(graph, labels, maxIter, threshold, delimiter);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
weightedSpeakerListenerLabelPropagation
public <ID> VertexProperty<ID,java.lang.String> weightedSpeakerListenerLabelPropagation(PgxGraph graph, java.lang.String labelsPropName, EdgeProperty<java.lang.Double> weight) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.
Definition
The speaker listener label propagation algorithm is an extension of the label propagation algorithm, which is able to detect overlapping communities. This variant uses the edges weight to find those communities.
Implementation Details
null
Complexity
- Time:
O(max_iter * N) with N = number of neighbors of vertex1, max_iter = number of iterations
- Space:
O(N + V * max_iter) with N = number of neighbors of vertex1, max_iter = number of iterations
Default Values
- max_iter: 100
- threshold: 0.0
- delimiter: |
Applications
- Parameters:
graph
- the graph.labelsPropName
- The name of the string property.weight
- edge property holding the weight of each edge in the graph.- Returns:
-
Examples
PgxGraph graph = ...; EdgeProperty<Double> weight = graph.getEdgeProperty("weight"); String labelsPropname="O___"; VertexProperty<ID, String> labels = analyst.speakerListenerLabelPropagation(graph, labelsPropName, weight);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
weightedSpeakerListenerLabelPropagation
public <ID> VertexProperty<ID,java.lang.String> weightedSpeakerListenerLabelPropagation(PgxGraph graph, java.lang.String labelsPropName, int maxIter, double threshold, java.lang.String delimiter, EdgeProperty<java.lang.Double> weight) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.
Definition
The speaker listener label propagation algorithm is an extension of the label propagation algorithm, which is able to detect overlapping communities. This variant uses the edges weight to find those communities.
Implementation Details
null
Complexity
- Time:
O(max_iter * N) with N = number of neighbors of vertex1, max_iter = number of iterations
- Space:
O(N + V * max_iter) with N = number of neighbors of vertex1, max_iter = number of iterations
Default Values
- max_iter: 100
- threshold: 0.0
- delimiter: |
Applications
- Parameters:
graph
- the graph.labelsPropName
- The name of the string property.maxIter
- number of iterations.threshold
- minimum frequency for a label to retain a vertex.delimiter
- string delimiter for labels.weight
- edge property holding the weight of each edge in the graph.- Returns:
-
Examples
PgxGraph graph = ...; EdgeProperty<Double> weight = graph.getEdgeProperty("weight"); String labelsPropname="O___"; int maxIter = 100; double threshold = 0.2; String delimiter = "|"; VertexProperty<ID, String> labels = analyst.weightedSpeakerListenerLabelPropagation(graph, labelsPropName, maxIter, threshold, delimiter, weight);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
weightedSpeakerListenerLabelPropagation
public <ID> VertexProperty<ID,java.lang.String> weightedSpeakerListenerLabelPropagation(PgxGraph graph, VertexProperty<ID,java.lang.String> labels, int maxIter, double threshold, java.lang.String delimiter, EdgeProperty<java.lang.Double> weight) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.
Definition
The speaker listener label propagation algorithm is an extension of the label propagation algorithm, which is able to detect overlapping communities. This variant uses the edges weight to find those communities.
Implementation Details
null
Complexity
- Time:
O(max_iter * N) with N = number of neighbors of vertex1, max_iter = number of iterations
- Space:
O(N + V * max_iter) with N = number of neighbors of vertex1, max_iter = number of iterations
Default Values
- max_iter: 100
- threshold: 0.0
- delimiter: |
Applications
- Parameters:
graph
- the graph.labels
-maxIter
- number of iterations.threshold
- minimum frequency for a label to retain a vertex.delimiter
- string delimiter for labels.weight
- edge property holding the weight of each edge in the graph.- Returns:
-
Examples
PgxGraph graph = ...; VertexProperty<ID, String> labels = graph.createVertexProperty(PropertyType.STRING); EdgeProperty<Double> weight = graph.getEdgeProperty("weight"); int maxIter = 100; double threshold = 0.2; String delimiter = "|"; VertexProperty<ID, String> labels = analyst.weightedSpeakerListenerLabelPropagation(graph, labels, maxIter, threshold, delimiter, weight);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
filteredSpeakerListenerLabelPropagation
public <ID> VertexProperty<ID,java.lang.String> filteredSpeakerListenerLabelPropagation(PgxGraph graph, java.lang.String labelsPropName, EdgeFilter filter) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.
Definition
The speaker listener label propagation algorithm is an extension of the label propagation algorithm, which is able to detect overlapping communities. This variant utilizes an edge filter to select which neighbors to listen to.
Implementation Details
null
Complexity
- Time:
O(max_iter * N) with N = number of neighbors of vertex1, max_iter = number of iterations
- Space:
O(N + V * max_iter) with N = number of neighbors of vertex1, max_iter = number of iterations
Default Values
- max_iter: 100
- threshold: 0.0
- delimiter: |
Applications
- Parameters:
graph
-labelsPropName
- The name of the string property.filter
-- Returns:
-
Examples
PgxGraph graph = ...; String labelsPropname="O___"; EdgeFilter filter = EdgeFilter.fromExpression("edge.weight > 2.7"); VertexProperty<ID, String> labels = analyst.filteredSpeakerListenerLabelPropagation(graph, labelsPropName, filter);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
filteredSpeakerListenerLabelPropagation
public <ID> VertexProperty<ID,java.lang.String> filteredSpeakerListenerLabelPropagation(PgxGraph graph, java.lang.String labelsPropName, int maxIter, double threshold, java.lang.String delimiter, EdgeFilter filter) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.
Definition
The speaker listener label propagation algorithm is an extension of the label propagation algorithm, which is able to detect overlapping communities. This variant utilizes an edge filter to select which neighbors to listen to.
Implementation Details
null
Complexity
- Time:
O(max_iter * N) with N = number of neighbors of vertex1, max_iter = number of iterations
- Space:
O(N + V * max_iter) with N = number of neighbors of vertex1, max_iter = number of iterations
Default Values
- max_iter: 100
- threshold: 0.0
- delimiter: |
Applications
- Parameters:
graph
-labelsPropName
- The name of the string property.maxIter
-threshold
-delimiter
-filter
-- Returns:
-
Examples
PgxGraph graph = ...; EdgeFilter filter = EdgeFilter.fromExpression("edge.weight > 2.7"); String labelsPropname="O___"; int maxIter = 100; double threshold = 0.2; String delimiter = "|"; VertexProperty<ID, String> labels = analyst.filteredSpeakerListenerLabelPropagation(graph, labelsPropName, maxIter, threshold, delimiter, filter);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
filteredSpeakerListenerLabelPropagation
public <ID> VertexProperty<ID,java.lang.String> filteredSpeakerListenerLabelPropagation(PgxGraph graph, VertexProperty<ID,java.lang.String> labels, int maxIter, double threshold, java.lang.String delimiter, EdgeFilter filter) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.
Definition
The speaker listener label propagation algorithm is an extension of the label propagation algorithm, which is able to detect overlapping communities. This variant utilizes an edge filter to select which neighbors to listen to.
Implementation Details
null
Complexity
- Time:
O(max_iter * N) with N = number of neighbors of vertex1, max_iter = number of iterations
- Space:
O(N + V * max_iter) with N = number of neighbors of vertex1, max_iter = number of iterations
Default Values
- max_iter: 100
- threshold: 0.0
- delimiter: |
Applications
- Parameters:
graph
-labels
-maxIter
-threshold
-delimiter
-filter
-- Returns:
-
Examples
PgxGraph graph = ...; VertexProperty<ID, String> labels = graph.createVertexProperty(PropertyType.STRING); EdgeFilter filter = EdgeFilter.fromExpression("edge.weight > 2.7"); int maxIter = 100; double threshold = 0.2; String delimiter = "|"; VertexProperty<ID, String> labels = analyst.filteredSpeakerListenerLabelPropagation(graph, labels, maxIter, threshold, delimiter, filter);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
filteredWeightedSpeakerListenerLabelPropagation
public <ID> VertexProperty<ID,java.lang.String> filteredWeightedSpeakerListenerLabelPropagation(PgxGraph graph, java.lang.String labelsPropName, EdgeProperty<java.lang.Double> weight, EdgeFilter filter) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.
Definition
The speaker listener label propagation algorithm is an extension of the label propagation algorithm, which is able to detect overlapping communities. This variant utilizes an edge filter to select which neighbors to listen to and uses the edges' weight to update the frequency of listened labels.
Implementation Details
null
Complexity
- Time:
O(max_iter * N) with N = number of neighbors of vertex1, max_iter = number of iterations
- Space:
O(N + V * max_iter) with N = number of neighbors of vertex1, max_iter = number of iterations
Default Values
- max_iter: 100
- threshold: 0.0
- delimiter: |
Applications
- Parameters:
graph
-labelsPropName
- The name of the string property.weight
-filter
-- Returns:
-
Examples
PgxGraph graph = ...; String labelsPropname="O___"; EdgeProperty<Double> weight = graph.getEdgeProperty("weight"); EdgeFilter filter = EdgeFilter.fromExpression("edge.weight > 2.7"); VertexProperty<ID, String> labels = analyst.filteredWeightedSpeakerListenerLabelPropagation(graph, labelsPropName, weight, filter);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
filteredWeightedSpeakerListenerLabelPropagation
public <ID> VertexProperty<ID,java.lang.String> filteredWeightedSpeakerListenerLabelPropagation(PgxGraph graph, java.lang.String labelsPropName, int maxIter, double threshold, java.lang.String delimiter, EdgeProperty<java.lang.Double> weight, EdgeFilter filter) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.
Definition
The speaker listener label propagation algorithm is an extension of the label propagation algorithm, which is able to detect overlapping communities. This variant utilizes an edge filter to select which neighbors to listen to and uses the edges' weight to update the frequency of listened labels.
Implementation Details
null
Complexity
- Time:
O(max_iter * N) with N = number of neighbors of vertex1, max_iter = number of iterations
- Space:
O(N + V * max_iter) with N = number of neighbors of vertex1, max_iter = number of iterations
Default Values
- max_iter: 100
- threshold: 0.0
- delimiter: |
Applications
- Parameters:
graph
-labelsPropName
- The name of the string property.maxIter
-threshold
-delimiter
-weight
-filter
-- Returns:
-
Examples
PgxGraph graph = ...; EdgeFilter filter = EdgeFilter.fromExpression("edge.weight > 2.7"); EdgeProperty<Double> weight = graph.getEdgeProperty("weight"); String labelsPropname="O___"; int maxIter = 100; double threshold = 0.2; String delimiter = "|"; VertexProperty<ID, String> labels = analyst.filteredWeightedSpeakerListenerLabelPropagation(graph, labelsPropName, maxIter, threshold, delimiter, weight, filter);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
filteredWeightedSpeakerListenerLabelPropagation
public <ID> VertexProperty<ID,java.lang.String> filteredWeightedSpeakerListenerLabelPropagation(PgxGraph graph, VertexProperty<ID,java.lang.String> labels, int maxIter, double threshold, java.lang.String delimiter, EdgeProperty<java.lang.Double> weight, EdgeFilter filter) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Speaker listener label propagation can find overlaping and multiple communities in a graph relatively fast.
Definition
The speaker listener label propagation algorithm is an extension of the label propagation algorithm, which is able to detect overlapping communities. This variant utilizes an edge filter to select which neighbors to listen to and uses the edges' weight to update the frequency of listened labels.
Implementation Details
null
Complexity
- Time:
O(max_iter * N) with N = number of neighbors of vertex1, max_iter = number of iterations
- Space:
O(N + V * max_iter) with N = number of neighbors of vertex1, max_iter = number of iterations
Default Values
- max_iter: 100
- threshold: 0.0
- delimiter: |
Applications
- Parameters:
graph
-labels
-maxIter
-threshold
-delimiter
-weight
-filter
-- Returns:
-
Examples
PgxGraph graph = ...; VertexProperty<ID, String> labels = graph.createVertexProperty(PropertyType.STRING); EdgeProperty<Double> weight = graph.getEdgeProperty("weight"); EdgeFilter filter = EdgeFilter.fromExpression("edge.weight > 2.7"); int maxIter = 100; double threshold = 0.2; String delimiter = "|"; VertexProperty<ID, String> labels = analyst.filteredWeightedSpeakerListenerLabelPropagation(graph, labels, maxIter, threshold, delimiter, weight, filter);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
countTriangles
public long countTriangles(PgxGraph graph, boolean sortVerticesByDegree) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
triangle counting gives an overview of the amount of connections between vertices in neighborhoods
Definition
This algorithm is intended for directed graphs and will count all the existing triangles on it. To run the algorithm on undirected graphs, use the undirected version.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(E ^ 1.5) with E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Triangles in graphs can be used as a measure of the quality in social networks, they can help to find communities within graphs.
- Parameters:
graph
- the graph.sortVerticesByDegree
- boolean flag for sorting the nodes by their degree as preprocessing step.- Returns:
- returns the total number of triangles found.
Examples
PgxGraph graph = ...; long result = analyst.countTriangles(graph, true);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
adamicAdarCounting
public <V> EdgeProperty<java.lang.Double> adamicAdarCounting(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
The adamic-adar index compares the amount of neighbors shared between vertices, this measure can be used with communities.
Definition
The Adamic-Adar index is meant for undirected graphs, since it is computed using the degree of the shared neighbors by two vertices in the graph. This implementation is intended for undirected graphs and computes the index for every pair of vertices connected by an edge and associates it with that edge.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(E) with E = number of edges
- Space:
O(E) with E = number of edges
Default Values
Applications
- The Adamic-Adar index can be used to find correlations between groups of people in social networks, thus characterize communities and also infer potential new links between them.
- Parameters:
graph
- the graph.- Returns:
- edge property holding the Adamic-Adar index of each edge in the graph.
Examples
PgxGraph graph = ...; EdgeProperty<Double> adamicAdar = analyst.adamicAdarCounting(graph); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + adamicAdar.getName() + " MATCH (x) ORDER BY x." + adamicAdar.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Link Prediction Problem for Social Networks.
- Time:
-
adamicAdarCounting
public <V> EdgeProperty<java.lang.Double> adamicAdarCounting(PgxGraph graph, EdgeProperty<java.lang.Double> aa) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
The adamic-adar index compares the amount of neighbors shared between vertices, this measure can be used with communities.
Definition
The Adamic-Adar index is meant for undirected graphs, since it is computed using the degree of the shared neighbors by two vertices in the graph. This implementation is intended for undirected graphs and computes the index for every pair of vertices connected by an edge and associates it with that edge.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(E) with E = number of edges
- Space:
O(E) with E = number of edges
Default Values
Applications
- The Adamic-Adar index can be used to find correlations between groups of people in social networks, thus characterize communities and also infer potential new links between them.
- Parameters:
graph
- the graph.aa
- (out argument) edge property holding the Adamic-Adar index of each edge in the graph.- Returns:
- edge property holding the Adamic-Adar index of each edge in the graph.
Examples
PgxGraph graph = ...; EdgeProperty<Double> aa = graph.createEdgeProperty(PropertyType.DOUBLE); EdgeProperty<Double> adamicAdar = analyst.adamicAdarCounting(graph, aa); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + adamicAdar.getName() + " MATCH (x) ORDER BY x." + adamicAdar.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- The Link Prediction Problem for Social Networks.
- Time:
-
randomWalkWithRestart
public <ID> PgxMap<PgxVertex<ID>,java.lang.Integer> randomWalkWithRestart(PgxGraph graph, PgxVertex<ID> source, int length, double resetProb, PgxMap<PgxVertex<ID>,java.lang.Integer> visitCount) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
random walk with restart does the what its name says, it can find approximate stationary distributions
Definition
This algorithm performs a random walk over the graph. The walk will start at the given source vertex and will randomly visit neighboring vertices in the graph, with a probability equal to the value of reset_probability of going back to the starting point. The random walk will also go back to the starting point every time it reaches a vertex with no outgoing edges. The algorithm will stop once it reaches the specified walk length.
Implementation Details
The implementation of this algorithm uses an iterative method. Since the algorithm visits the vertices in a random order on each iteration it is non-deterministic.
Complexity
- Time:
O(L) with L = length of the random walk
- Space:
O(V) with V = number of vertices
Default Values
Applications
- The information gathered from a random walk can be used to approximate stationary distributions when the number of visits is normalized
- Parameters:
graph
- the graph.source
- (in argument) starting point of the random walk.length
- (in argument) length (number of steps) of the random walk.resetProb
- (in argument) probability value for resetting the random walk.visitCount
- (out argument) map holding the number of visits during the random walk for each vertex in the graph.- Returns:
- map holding the number of visits during the random walk for each vertex in the graph.
Examples
PgxGraph graph = ...; PgxMap<PgxVertex, Integer> visitCount = graph.createMap(PropertyType.VERTEX, PropertyType.INTEGER); PgxMap<PgxVertex, Integer> count = analyst.randomWalkWithRestart(graph, 0, 100, 0,6, visit_count);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- Random Walks on Graphs: A Survey
- Time:
-
bipartiteCheck
public <ID> VertexProperty<ID,java.lang.Boolean> bipartiteCheck(PgxGraph graph, VertexProperty<ID,java.lang.Boolean> isLeft) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Bipartite check verifies whether are graph is a bipartite graph.
Definition
This algorithm checks whether the given directed graph is bipartite. It assumes that all the edges are going in the same direction since the method relies on BFS traversals of the graph. If the graph is bipartite the algorithm will return the side of each vertex in the graph with the is_left vertex property.
Implementation Details
The implementation of this algorithm uses a built-in BFS method for the graph traversals.
Complexity
- Time:
O(E) with E = number of edges
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- Checking whether a graph is a bipartite one is important since some other graph algorithms rely on this particular condition.
- Parameters:
graph
- the graph.isLeft
- vertex property holding the side of each vertex in a bipartite graph (true for left, false for right).- Returns:
- vertex property holding the side of each vertex in a bipartite graph (true for left, false for right).
Examples
PgxGraph graph = ...; VertexProperty<Integer, Boolean> isLeft = graph.createVertexProperty(PropertyType.BOOLEAN); VertexProperty<Integer, Boolean> bipartite = analyst.BipartiteCheck(graph, isLeft);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- Bipartite Graph.
- Time:
-
conductance
public <ID> Scalar<java.lang.Double> conductance(PgxGraph graph, Partition<ID> partition, long partitionIndex) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Conductance assesses the quality of a partition in a graph
Definition
Conductance in a graph is computed for a specific cut of it. A cut is a partition of the graph into two subsets (components), disconnecting the graph if the edges from the cut are removed. Thus the algorithm requires a labeling for the vertices in the different subsets of the graph, then the conductance is computed by the ratio of the edges belonging to the given cut (i.e. the edges that split the graph into disconnected components) and the edges belonging to each of these subsets. If there is more than one cut (or partition), this implementation will take the given component number as reference to compute the conductance associated with that particular cut.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V) with V = number of vertices
- Space:
O(1)
Default Values
- num: 0
Applications
- Conductance can be used to measure how well connected a graph is, making it an useful auxiliary measure to assess the quality of clusters in a graph, since these could be regarded as the subsets of a cut.
- Parameters:
graph
- the graph.partition
- Partition of the graph with the corresponding node collections.partitionIndex
- number of the component to be used for computing its conductance.- Returns:
- Scalar (double) to store the conductance value of the given cut.
Examples
PgxGraph graph = ...; Partition<Integer> partition = analyst.communitiesConductanceMinimization(graph); Scalar<Double> conductance = analyst.conductance(graph, partition, 0); conductance.get();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- Graph Conductance.
- Time:
-
conductance
public <ID> Scalar<java.lang.Double> conductance(PgxGraph graph, Partition<ID> partition, long partitionIndex, Scalar<java.lang.Double> conductance) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Conductance assesses the quality of a partition in a graph
Definition
Conductance in a graph is computed for a specific cut of it. A cut is a partition of the graph into two subsets (components), disconnecting the graph if the edges from the cut are removed. Thus the algorithm requires a labeling for the vertices in the different subsets of the graph, then the conductance is computed by the ratio of the edges belonging to the given cut (i.e. the edges that split the graph into disconnected components) and the edges belonging to each of these subsets. If there is more than one cut (or partition), this implementation will take the given component number as reference to compute the conductance associated with that particular cut.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V) with V = number of vertices
- Space:
O(1)
Default Values
- num: 0
Applications
- Conductance can be used to measure how well connected a graph is, making it an useful auxiliary measure to assess the quality of clusters in a graph, since these could be regarded as the subsets of a cut.
- Parameters:
graph
- the graph.partition
- Partition of the graph with the corresponding node collections.partitionIndex
- number of the component to be used for computing its conductance.conductance
- Scalar (double) to store the conductance value of the given cut.- Returns:
- Scalar (double) to store the conductance value of the given cut.
Examples
PgxGraph graph = ...; Partition<Integer> partition = analyst.communitiesConductanceMinimization(graph); Scalar<Double> scalar = graph.createScalar(PropertyType.DOUBLE); Scalar<Double> conductance = analyst.conductance(graph, partition, 0, scalar); conductance.get();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- Graph Conductance.
- Time:
-
partitionModularity
public <ID> Scalar<java.lang.Double> partitionModularity(PgxGraph graph, Partition<ID> partition) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Modularity summarizes information about the quality of components in a graph
Definition
Modularity in a graph is a measure for assessing the quality of the partition induced by the components (or community structures) within the graph found by any clustering algorithm (e.g. label propagation, Infomap, WCC, etc.). It compares the number of the edges between the vertices within a component against the expected number of edges if these were generated at random (assuming a uniform probability distribution). A positive modularity value means that, on average, there are more edges within the components than the amount expected (meaning stronger components), and vice-versa for a negative modularity value. This implementation is intended for directed graphs.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization. Note that this algorithm will be inefficient if number_of_components are big (i.e. O(N)).
Complexity
- Time:
O(E * c) with E = number of edges, c = number of components
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Since modularity help to assess the quality of communities in a graph, it can be used in optimization processes when detecting them in other algorithms.
- Parameters:
graph
- the graph.partition
- Partition of the graph with the corresponding node collections.- Returns:
- Scalar (double) with the modularity value.
Examples
PgxGraph graph = ...; Partition<Integer> partition = analyst.communitiesConductanceMinimization(graph); Scalar<Double> modularity = analyst.partitionModularity(graph, partition); modularity.get();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
partitionModularity
public <ID> Scalar<java.lang.Double> partitionModularity(PgxGraph graph, Partition<ID> partition, Scalar<java.lang.Double> modularity) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Modularity summarizes information about the quality of components in a graph
Definition
Modularity in a graph is a measure for assessing the quality of the partition induced by the components (or community structures) within the graph found by any clustering algorithm (e.g. label propagation, Infomap, WCC, etc.). It compares the number of the edges between the vertices within a component against the expected number of edges if these were generated at random (assuming a uniform probability distribution). A positive modularity value means that, on average, there are more edges within the components than the amount expected (meaning stronger components), and vice-versa for a negative modularity value. This implementation is intended for directed graphs.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization. Note that this algorithm will be inefficient if number_of_components are big (i.e. O(N)).
Complexity
- Time:
O(E * c) with E = number of edges, c = number of components
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Since modularity help to assess the quality of communities in a graph, it can be used in optimization processes when detecting them in other algorithms.
- Parameters:
graph
- the graph.partition
- Partition of the graph with the corresponding node collections.modularity
- Scalar (double) to store the modularity value.- Returns:
- Scalar (double) with the modularity value.
Examples
PgxGraph graph = ...; Partition<Integer> partition = analyst.communitiesConductanceMinimization(graph); Scalar<Double> scalar = graph.createScalar(PropertyType.DOUBLE); Scalar<Double> modularity = analyst.partitionModularity(graph, partition, scalar); modularity.get();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
partitionConductance
public <ID> Pair<Scalar<java.lang.Double>,Scalar<java.lang.Double>> partitionConductance(PgxGraph graph, Partition<ID> partition) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Partition conductance assesses the quality of many partitions in a graph
Definition
This variant of the conductance algorithm will compute the conductance for the given number of components, returning an output with the minimum value of conductance found from the corresponding partitions and their average conductance value.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization. Note that this algorithm will be inefficient if number_of_components are big (i.e. O(N)).
Complexity
- Time:
O(E) with E = number of edges
- Space:
O(1)
Default Values
Applications
- Conductance can be used to measure how well connected is a graph, making it an useful auxiliary measure to assess the quality of clusters in a graph, since these could be regarded as the subsets of a cut.
- Parameters:
graph
- the graph.partition
- Partition of the graph with the corresponding node collections.- Returns:
- Pair with two scalars, the first one with the value of the average conductance, and the second with
minimun conductance value.
Examples
PgxGraph graph = ...; Partition<Integer> partition = analyst.communitiesConductanceMinimization(graph); Pair<Scalar<Double>, Scalar<Double>> conductance = analyst.partitionConductance(graph, partition); conductance.getFirst().get(); conductance.getSecond().get();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
partitionConductance
public <ID> Pair<Scalar<java.lang.Double>,Scalar<java.lang.Double>> partitionConductance(PgxGraph graph, Partition<ID> partition, Scalar<java.lang.Double> avgConductance, Scalar<java.lang.Double> minConductance) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Partition conductance assesses the quality of many partitions in a graph
Definition
This variant of the conductance algorithm will compute the conductance for the given number of components, returning an output with the minimum value of conductance found from the corresponding partitions and their average conductance value.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization. Note that this algorithm will be inefficient if number_of_components are big (i.e. O(N)).
Complexity
- Time:
O(E) with E = number of edges
- Space:
O(1)
Default Values
Applications
- Conductance can be used to measure how well connected is a graph, making it an useful auxiliary measure to assess the quality of clusters in a graph, since these could be regarded as the subsets of a cut.
- Parameters:
graph
- the graph.partition
- Partition of the graph with the corresponding node collections.avgConductance
- Scalar that will get updated with the computed average conductance value.minConductance
- Scalar that will get updated with the computed minimum conductance value.- Returns:
- Pair with two scalars, the first one with the value of the average conductance, and the second with
minimun conductance value.
Examples
PgxGraph graph = ...; Partition<Integer> partition = analyst.communitiesConductanceMinimization(graph); Scalar<Double> avgConductance = graph.createScalar(PropertyType.DOUBLE); Scalar<Double> minConductance = graph.createScalar(PropertyType.DOUBLE); Pair<Scalar<Double>, Scalar<Double>> conductance = analyst.partitionConductance(graph, partition, avgConductance, minConductance); conductance.getFirst().get(); conductance.getSecond().get();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
kcore
public <ID> Pair<Scalar<java.lang.Long>,VertexProperty<ID,java.lang.Long>> kcore(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
k-core decomposes a graph into layers revealing subgraphs with particular properties
Definition
A k-core is a maximal subgraph in which all of its vertices are connected and have the property that all of them have a degree of at least k. The k-cores can be regarded as layers in a graph, since a (k+1)-core will always be a subgraph of a k-core. This means that the larger k becomes, the smaller its k-core (i.e. its corresponding subgraph) will be. The k-core value (or coreness) assigned to a vertex will correspond to the core with the greatest degree from all the cores where it belongs. This implementation of k-core will look for cores lying within the interval set by the min_core and max_core input variables.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- K-Core can be used to analyze hierarchical structures in a graph by revealing subgraphs with particular properties. It can also help to visualize large graphs in 2D by using the "layers" provided by the k-cores.
- Parameters:
graph
- the graph.- Returns:
- Pair holding the maximum core found and a node property with the largest k-core value for each node.
Examples
PgxGraph graph = ...; Pair<Scalar<Long>, VertexProperty<Integer, Long>> kcore = analyst.kcore(graph); kcore.getFirst().get(); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + kcore.getSecond().getName() + " MATCH (x) ORDER BY x." + kcore.getSecond().getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- An O(m) Algorithm for Cores Decomposition of Networks, k-core decomposition: a tool for the visualization of large scale networks
- Time:
-
kcore
public <ID> Pair<Scalar<java.lang.Long>,VertexProperty<ID,java.lang.Long>> kcore(PgxGraph graph, int minCore, int maxCore) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
k-core decomposes a graph into layers revealing subgraphs with particular properties
Definition
A k-core is a maximal subgraph in which all of its vertices are connected and have the property that all of them have a degree of at least k. The k-cores can be regarded as layers in a graph, since a (k+1)-core will always be a subgraph of a k-core. This means that the larger k becomes, the smaller its k-core (i.e. its corresponding subgraph) will be. The k-core value (or coreness) assigned to a vertex will correspond to the core with the greatest degree from all the cores where it belongs. This implementation of k-core will look for cores lying within the interval set by the min_core and max_core input variables.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- K-Core can be used to analyze hierarchical structures in a graph by revealing subgraphs with particular properties. It can also help to visualize large graphs in 2D by using the "layers" provided by the k-cores.
- Parameters:
graph
- the graph.minCore
- minimum k-core value.maxCore
- maximum k-core value.- Returns:
- Pair holding the maximum core found and a node property with the largest k-core value for each node.
Examples
PgxGraph graph = ...; Pair<Scalar<Long>, VertexProperty<Integer, Long>> kcore = analyst.kcore(graph, 0, 2147483647); kcore.getFirst().get(); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + kcore.getSecond().getName() + " MATCH (x) ORDER BY x." + kcore.getSecond().getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- An O(m) Algorithm for Cores Decomposition of Networks, k-core decomposition: a tool for the visualization of large scale networks
- Time:
-
kcore
public <ID> Pair<Scalar<java.lang.Long>,VertexProperty<ID,java.lang.Long>> kcore(PgxGraph graph, Scalar<java.lang.Long> maxKCore, VertexProperty<ID,java.lang.Long> kcore) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
k-core decomposes a graph into layers revealing subgraphs with particular properties
Definition
A k-core is a maximal subgraph in which all of its vertices are connected and have the property that all of them have a degree of at least k. The k-cores can be regarded as layers in a graph, since a (k+1)-core will always be a subgraph of a k-core. This means that the larger k becomes, the smaller its k-core (i.e. its corresponding subgraph) will be. The k-core value (or coreness) assigned to a vertex will correspond to the core with the greatest degree from all the cores where it belongs. This implementation of k-core will look for cores lying within the interval set by the min_core and max_core input variables.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- K-Core can be used to analyze hierarchical structures in a graph by revealing subgraphs with particular properties. It can also help to visualize large graphs in 2D by using the "layers" provided by the k-cores.
- Parameters:
graph
- the graph.maxKCore
- Scalar (long) for holding the value of the maximum k-core found by the algorithm.kcore
- (out argument) vertex property with the largest k-core value for each vertex.- Returns:
- Pair holding the maximum core found and a node property with the largest k-core value for each node.
Examples
PgxGraph graph = ...; Scalar<Long> scalar = graph.createScalar(PropertyType.LONG); VertexProperty<Integer, Long> prop = graph.CreateVertexProperty(PropertyType.LONG); Pair<Scalar<Long>, VertexProperty<Integer, Long>> kcore = analyst.kcore(graph, scalar, prop); kcore.getFirst().get(); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + kcore.getSecond().getName() + " MATCH (x) ORDER BY x." + kcore.getSecond().getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- An O(m) Algorithm for Cores Decomposition of Networks, k-core decomposition: a tool for the visualization of large scale networks
- Time:
-
kcore
public <ID> Pair<Scalar<java.lang.Long>,VertexProperty<ID,java.lang.Long>> kcore(PgxGraph graph, int minCore, int maxCore, Scalar<java.lang.Long> maxKCore, VertexProperty<ID,java.lang.Long> kcore) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
k-core decomposes a graph into layers revealing subgraphs with particular properties
Definition
A k-core is a maximal subgraph in which all of its vertices are connected and have the property that all of them have a degree of at least k. The k-cores can be regarded as layers in a graph, since a (k+1)-core will always be a subgraph of a k-core. This means that the larger k becomes, the smaller its k-core (i.e. its corresponding subgraph) will be. The k-core value (or coreness) assigned to a vertex will correspond to the core with the greatest degree from all the cores where it belongs. This implementation of k-core will look for cores lying within the interval set by the min_core and max_core input variables.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- K-Core can be used to analyze hierarchical structures in a graph by revealing subgraphs with particular properties. It can also help to visualize large graphs in 2D by using the "layers" provided by the k-cores.
- Parameters:
graph
- the graph.minCore
- minimum k-core value.maxCore
- maximum k-core value.maxKCore
- Scalar (long) for holding the value of the maximum k-core found by the algorithm.kcore
- (out argument) vertex property with the largest k-core value for each vertex.- Returns:
- Pair holding the maximum core found and a node property with the largest k-core value for each node.
Examples
PgxGraph graph = ...; Scalar<Long> scalar = graph.createScalar(PropertyType.LONG); VertexProperty<Integer, Long> prop = graph.CreateVertexProperty(PropertyType.LONG); Pair<Scalar<Long>, VertexProperty<Integer, Long>> kcore = analyst.kcore(graph, 0, 2147483647, scalar, prop); kcore.getFirst().get(); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + kcore.getSecond().getName() + " MATCH (x) ORDER BY x." + kcore.getSecond().getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- An O(m) Algorithm for Cores Decomposition of Networks, k-core decomposition: a tool for the visualization of large scale networks
- Time:
-
diameter
public <ID> Pair<Scalar<java.lang.Integer>,VertexProperty<ID,java.lang.Integer>> diameter(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Diameter/radius gives an overview of the distances in a graph
Definition
The diameter of a graph is the maximal value of eccentricity of all the vertices in the graph, while the radius is the minimum graph eccentricity. The eccentricity of a vertex is the maximum distance via shortest paths to any other vertex in the graph. This algorithm will compute the eccentricity of all the vertices and will also return the diameter or radius value depending on the request. The algorithm will return an INF eccentricity and diameter/radius, for graphs with more than one strongly connected component.
Implementation Details
The implementation of this algorithm uses a parallel BFS method called Multi-Source BFS (MS-BSF) for a faster and more efficient search of the shortest paths. It still is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
- diameterOn: true
Applications
- This algorithm computes a basic structural graph property that is useful when looking for distances in a graph.
- Parameters:
graph
- the graph.- Returns:
- Pair holding the diameter of the graph and a node property with eccentricity value for each node.
Examples
PgxGraph graph = ...; Pair<Scalar<Integer>, VertexProperty<Integer, Integer>> diameter = analyst.diameter(graph); diameter.getFirst().get(); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + diameter.getSecond().getName() + " MATCH (x) ORDER BY x." + diameter.getSecond().getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
diameter
public <ID> Pair<Scalar<java.lang.Integer>,VertexProperty<ID,java.lang.Integer>> diameter(PgxGraph graph, Scalar<java.lang.Integer> diameter, VertexProperty<ID,java.lang.Integer> eccentricity) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Diameter/radius gives an overview of the distances in a graph
Definition
The diameter of a graph is the maximal value of eccentricity of all the vertices in the graph, while the radius is the minimum graph eccentricity. The eccentricity of a vertex is the maximum distance via shortest paths to any other vertex in the graph. This algorithm will compute the eccentricity of all the vertices and will also return the diameter or radius value depending on the request. The algorithm will return an INF eccentricity and diameter/radius, for graphs with more than one strongly connected component.
Implementation Details
The implementation of this algorithm uses a parallel BFS method called Multi-Source BFS (MS-BSF) for a faster and more efficient search of the shortest paths. It still is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
- diameterOn: true
Applications
- This algorithm computes a basic structural graph property that is useful when looking for distances in a graph.
- Parameters:
graph
- the graph.diameter
- Scalar (integer) for holding the value of the diameter of the graph.eccentricity
- (out argument) vertex property holding the eccentricity value for each vertex.- Returns:
- Pair holding the diameter of the graph and a node property with eccentricity value for each node.
Examples
PgxGraph graph = ...; Scalar<Integer> scalar = graph.createScalar(PropertyType.INTEGER); VertexProperty<Integer, Integer> prop = graph.CreateVertexProperty(PropertyType.INTEGER); Pair<Scalar<Integer>, VertexProperty<Integer, Integer>> diameter = analyst.diameter(graph, scalar, prop); diameter.getFirst().get(); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + diameter.getSecond().getName() + " MATCH (x) ORDER BY x." + diameter.getSecond().getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
radius
public <ID> Pair<Scalar<java.lang.Integer>,VertexProperty<ID,java.lang.Integer>> radius(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Diameter/radius gives an overview of the distances in a graph
Definition
The diameter of a graph is the maximal value of eccentricity of all the vertices in the graph, while the radius is the minimum graph eccentricity. The eccentricity of a vertex is the maximum distance via shortest paths to any other vertex in the graph. This algorithm will compute the eccentricity of all the vertices and will also return the diameter or radius value depending on the request. The algorithm will return an INF eccentricity and diameter/radius, for graphs with more than one strongly connected component.
Implementation Details
The implementation of this algorithm uses a parallel BFS method called Multi-Source BFS (MS-BSF) for a faster and more efficient search of the shortest paths. It still is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
- diameterOn: true
Applications
- This algorithm computes a basic structural graph property that is useful when looking for distances in a graph.
- Parameters:
graph
- the graph.- Returns:
- Pair holding the radius of the graph and a node property with eccentricity value for each node.
Examples
PgxGraph graph = ...; Pair<Scalar<Integer>, VertexProperty<Integer, Integer>> diameter = analyst.radius(graph); radius.getFirst().get(); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + radius.getSecond().getName() + " MATCH (x) ORDER BY x." + radius.getSecond().getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
radius
public <ID> Pair<Scalar<java.lang.Integer>,VertexProperty<ID,java.lang.Integer>> radius(PgxGraph graph, Scalar<java.lang.Integer> radius, VertexProperty<ID,java.lang.Integer> eccentricity) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Diameter/radius gives an overview of the distances in a graph
Definition
The diameter of a graph is the maximal value of eccentricity of all the vertices in the graph, while the radius is the minimum graph eccentricity. The eccentricity of a vertex is the maximum distance via shortest paths to any other vertex in the graph. This algorithm will compute the eccentricity of all the vertices and will also return the diameter or radius value depending on the request. The algorithm will return an INF eccentricity and diameter/radius, for graphs with more than one strongly connected component.
Implementation Details
The implementation of this algorithm uses a parallel BFS method called Multi-Source BFS (MS-BSF) for a faster and more efficient search of the shortest paths. It still is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
- diameterOn: true
Applications
- This algorithm computes a basic structural graph property that is useful when looking for distances in a graph.
- Parameters:
graph
- the graph.radius
- Scalar (integer) for holding the value of the radius of the graph.eccentricity
- (out argument) vertex property holding the eccentricity value for each vertex.- Returns:
- Pair holding the radius of the graph and a node property with eccentricity value for each node.
Examples
PgxGraph graph = ...; Scalar<Integer> scalar = graph.createScalar(PropertyType.INTEGER); VertexProperty<Integer, Integer> prop = graph.CreateVertexProperty(PropertyType.INTEGER); Pair<Scalar<Integer>, VertexProperty<Integer, Integer>> diameter = analyst.radius(graph, scalar, prop); radius.getFirst().get(); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + radius.getSecond().getName() + " MATCH (x) ORDER BY x." + radius.getSecond().getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
periphery
public <ID> VertexSet<ID> periphery(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Periphery/center gives an overview of the extreme distances and the corresponding vertices in a graph
Definition
The periphery of a graph is the set of vertices that have an eccentricity value equal to the diameter of the graph. Similarly, the center is comprised by the set of vertices with eccentricity equal to the radius of the graph. The diameter of a graph is the maximal value of eccentricity of all the vertices in the graph, while the radius is the minimum graph eccentricity. The eccentricity of a vertex is the maximum distance via shortest paths to any other vertex in the graph. This algorithm will return the set of vertices from the periphery or the center of the graph, depending on the request. The algorithm will return a set with all the vertices for graphs with more than one strongly connected component.
Implementation Details
The implementation of this algorithm uses a parallel BFS method called Multi-Source BFS (MS-BSF) for a faster and more efficient search of the shortests paths. It still is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- This algorithm computes a basic structural graph property that is useful when looking for distances in a graph.
- Parameters:
graph
- the graph.- Returns:
- vertex set holding the vertices from the periphery or center of the graph.
Examples
PgxGraph graph = ...; VertexSet<Integer> periphery = analyst.periphery(graph);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
periphery
public <ID> VertexSet<ID> periphery(PgxGraph graph, VertexSet<ID> periphery) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Periphery/center gives an overview of the extreme distances and the corresponding vertices in a graph
Definition
The periphery of a graph is the set of vertices that have an eccentricity value equal to the diameter of the graph. Similarly, the center is comprised by the set of vertices with eccentricity equal to the radius of the graph. The diameter of a graph is the maximal value of eccentricity of all the vertices in the graph, while the radius is the minimum graph eccentricity. The eccentricity of a vertex is the maximum distance via shortest paths to any other vertex in the graph. This algorithm will return the set of vertices from the periphery or the center of the graph, depending on the request. The algorithm will return a set with all the vertices for graphs with more than one strongly connected component.
Implementation Details
The implementation of this algorithm uses a parallel BFS method called Multi-Source BFS (MS-BSF) for a faster and more efficient search of the shortests paths. It still is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- This algorithm computes a basic structural graph property that is useful when looking for distances in a graph.
- Parameters:
graph
- the graph.periphery
- (out argument) vertex set holding the vertices from the periphery or center of the graph.- Returns:
- vertex set holding the vertices from the periphery or center of the graph.
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.createVertexSet(); VertexSet<Integer> periphery = analyst.periphery(graph, vertices);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
center
public <ID> VertexSet<ID> center(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Periphery/center gives an overview of the extreme distances and the corresponding vertices in a graph
Definition
The periphery of a graph is the set of vertices that have an eccentricity value equal to the diameter of the graph. Similarly, the center is comprised by the set of vertices with eccentricity equal to the radius of the graph. The diameter of a graph is the maximal value of eccentricity of all the vertices in the graph, while the radius is the minimum graph eccentricity. The eccentricity of a vertex is the maximum distance via shortest paths to any other vertex in the graph. This algorithm will return the set of vertices from the periphery or the center of the graph, depending on the request. The algorithm will return a set with all the vertices for graphs with more than one strongly connected component.
Implementation Details
The implementation of this algorithm uses a parallel BFS method called Multi-Source BFS (MS-BSF) for a faster and more efficient search of the shortests paths. It still is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- This algorithm computes a basic structural graph property that is useful when looking for distances in a graph.
- Parameters:
graph
- the graph.- Returns:
- vertex set holding the vertices from the periphery or center of the graph.
Examples
PgxGraph graph = ...; VertexSet<Integer> center = analyst.center(graph);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
center
public <ID> VertexSet<ID> center(PgxGraph graph, VertexSet<ID> center) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Periphery/center gives an overview of the extreme distances and the corresponding vertices in a graph
Definition
The periphery of a graph is the set of vertices that have an eccentricity value equal to the diameter of the graph. Similarly, the center is comprised by the set of vertices with eccentricity equal to the radius of the graph. The diameter of a graph is the maximal value of eccentricity of all the vertices in the graph, while the radius is the minimum graph eccentricity. The eccentricity of a vertex is the maximum distance via shortest paths to any other vertex in the graph. This algorithm will return the set of vertices from the periphery or the center of the graph, depending on the request. The algorithm will return a set with all the vertices for graphs with more than one strongly connected component.
Implementation Details
The implementation of this algorithm uses a parallel BFS method called Multi-Source BFS (MS-BSF) for a faster and more efficient search of the shortests paths. It still is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * E) with V = number of vertices, E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- This algorithm computes a basic structural graph property that is useful when looking for distances in a graph.
- Parameters:
graph
- the graph.center
- (out argument) vertex set holding the vertices from the periphery or center of the graph.- Returns:
- vertex set holding the vertices from the periphery or center of the graph.
Examples
PgxGraph graph = ...; VertexSet<Integer> vertices = graph.createVertexSet(); VertexSet<Integer> center = analyst.center(graph, vertices);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
localClusteringCoefficient
public <ID> VertexProperty<ID,java.lang.Double> localClusteringCoefficient(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
LCC gives information about potential clustering options in a graph
Definition
The LCC of a vertex V is the fraction of connections between each pair of neighbors of V, i.e. the fraction of existing triangles from all the possible triangles involving V and every other pair of neighbor vertices of V. This implementation is intended for undirected graphs. Nodes with a degree smaller than 2 will be assigned a LCC value of 0.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V ^ 2) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- LCC can be used to determine how likely are vertices to cluster together, since it assess the degree of connections between a vertex and its neighbors. It could be used in social networks to spot out groups of people (communities), since people in groups tend to have a high density of links between them.
- Parameters:
graph
- the graph.- Returns:
- vertex property holding the lcc value for each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> lcc = analyst.localClusteringCoefficient(graph); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + lcc.getName() + " MATCH (x) ORDER BY x." + lcc.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- Approximating Clustering Coefficient and Transitivity, Clustering Coefficient
- Time:
-
localClusteringCoefficient
public <ID> VertexProperty<ID,java.lang.Double> localClusteringCoefficient(PgxGraph graph, VertexProperty<ID,java.lang.Double> lcc) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
LCC gives information about potential clustering options in a graph
Definition
The LCC of a vertex V is the fraction of connections between each pair of neighbors of V, i.e. the fraction of existing triangles from all the possible triangles involving V and every other pair of neighbor vertices of V. This implementation is intended for undirected graphs. Nodes with a degree smaller than 2 will be assigned a LCC value of 0.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V ^ 2) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- LCC can be used to determine how likely are vertices to cluster together, since it assess the degree of connections between a vertex and its neighbors. It could be used in social networks to spot out groups of people (communities), since people in groups tend to have a high density of links between them.
- Parameters:
graph
- the graph.lcc
- (out argument)- Returns:
- vertex property holding the lcc value for each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> prop = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> lcc = analyst.localClusteringCoefficient(graph, prop); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + lcc.getName() + " MATCH (x) ORDER BY x." + lcc.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- Approximating Clustering Coefficient and Transitivity, Clustering Coefficient
- Time:
-
localClusteringCoefficient
public <ID> VertexProperty<ID,java.lang.Double> localClusteringCoefficient(PgxGraph graph, boolean ignoreEdgeDirection) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
LCC gives information about potential clustering options in a graph
Definition
The LCC of a vertex V is the fraction of connections between each pair of neighbors of V, i.e. the fraction of existing triangles from all the possible triangles involving V and every other pair of neighbor vertices of V. This implementation is intended for undirected graphs. Nodes with a degree smaller than 2 will be assigned a LCC value of 0.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V ^ 2) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- LCC can be used to determine how likely are vertices to cluster together, since it assess the degree of connections between a vertex and its neighbors. It could be used in social networks to spot out groups of people (communities), since people in groups tend to have a high density of links between them.
- Parameters:
graph
- the graph.ignoreEdgeDirection
- boolean flag for ignoring the direction of the edges during the search.- Returns:
- vertex property holding the lcc value for each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> lcc = analyst.localClusteringCoefficient(graph); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + lcc.getName() + " MATCH (x) ORDER BY x." + lcc.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- Approximating Clustering Coefficient and Transitivity, Clustering Coefficient
- Time:
-
localClusteringCoefficient
public <ID> VertexProperty<ID,java.lang.Double> localClusteringCoefficient(PgxGraph graph, VertexProperty<ID,java.lang.Double> lcc, boolean ignoreEdgeDirection) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
LCC gives information about potential clustering options in a graph
Definition
The LCC of a vertex V is the fraction of connections between each pair of neighbors of V, i.e. the fraction of existing triangles from all the possible triangles involving V and every other pair of neighbor vertices of V. This implementation is intended for undirected graphs. Nodes with a degree smaller than 2 will be assigned a LCC value of 0.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V ^ 2) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- LCC can be used to determine how likely are vertices to cluster together, since it assess the degree of connections between a vertex and its neighbors. It could be used in social networks to spot out groups of people (communities), since people in groups tend to have a high density of links between them.
- Parameters:
graph
- the graph.lcc
- (out argument)ignoreEdgeDirection
- boolean flag for ignoring the direction of the edges during the search.- Returns:
- vertex property holding the lcc value for each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Double> prop = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, Double> lcc = analyst.localClusteringCoefficient(graph, prop); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + lcc.getName() + " MATCH (x) ORDER BY x." + lcc.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- Approximating Clustering Coefficient and Transitivity, Clustering Coefficient
- Time:
-
findCycle
public <ID> PgxPath<ID> findCycle(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Find cycle looks for any loop in the graph.
Definition
This algorithm tries to find a cycle in a directed graph using DFS traversals and will return the first cycle found, if there is one. In such case, the vertices and edges involved in the cycle will be returned in the order of visit. The algorithm is expensive because it will perform DFS traversals using different vertices as starting points until it explores the whole graph (worst-case scenario), or until it finds a cycle.
Implementation Details
The implementation of this algorithm uses a built-in DFS feature. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * (V + E)) with V = number of vertices, E = number of edges
- Space:
O(5 * V + E) with V = number of vertices, E = number of edges
Default Values
Applications
- Cycles in a graph can be useful in problems related to routes and flows.
- Parameters:
graph
- the graph.- Returns:
- PgxPath representing the cycle as path, if exists.
Examples
PgxGraph graph = ...; PgxPath<Integer> cycle = analyst.findCycle(graph); cycle.getPathLengthWithCost();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
findCycle
public <ID> PgxPath<ID> findCycle(PgxGraph graph, VertexSequence<ID> nodeSeq, EdgeSequence edgeSeq) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Find cycle looks for any loop in the graph.
Definition
This algorithm tries to find a cycle in a directed graph using DFS traversals and will return the first cycle found, if there is one. In such case, the vertices and edges involved in the cycle will be returned in the order of visit. The algorithm is expensive because it will perform DFS traversals using different vertices as starting points until it explores the whole graph (worst-case scenario), or until it finds a cycle.
Implementation Details
The implementation of this algorithm uses a built-in DFS feature. It is an expensive algorithm to run on large graphs.
Complexity
- Time:
O(V * (V + E)) with V = number of vertices, E = number of edges
- Space:
O(5 * V + E) with V = number of vertices, E = number of edges
Default Values
Applications
- Cycles in a graph can be useful in problems related to routes and flows.
- Parameters:
graph
- the graph.nodeSeq
- (out argument) vertex sequence holding the vertices in the cycle.edgeSeq
- (out argument) edge sequence holding the edges in the cycle.- Returns:
- PgxPath representing the cycle as path, if exists.
Examples
PgxGraph graph = ...; VertexSequence<Integer> nodeSeq = graph.createVertexSequence(); EdgeSequence edgeSeq = graph.createEdgeSequence(); PgxPath<Integer> cycle = analyst.findCycle(graph, nodeSeq, edgeSeq); cycle.getPathLengthWithCost();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
findCycle
public <ID> PgxPath<ID> findCycle(PgxGraph graph, PgxVertex<ID> src) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Find cycle looks for any loop in the graph.
Definition
This implementation tries to find a cycle in a directed graph using the given vertex as starting point for the DFS traversal and will return the first cycle found, if there is one. In such case, the vertices and edges involved in the cycle will be returned in the order of visit. Restricting the DFS traversal to a single starting point means that some parts of the graph may not get explored.
Implementation Details
The implementation of this algorithm uses a built-in DFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(4 * V + E) with V = number of vertices, E = number of edges
Default Values
- s: 0
Applications
- Cycles in a graph can be useful in problems related to routes and flows.
- Parameters:
graph
- the graph.src
- source vertex for the search.- Returns:
- PgxPath representing the cycle as path, if exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); PgxPath<Integer> cycle = analyst.findCycle(graph, vertex); cycle.getPathLengthWithCost();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
findCycle
public <ID> PgxPath<ID> findCycle(PgxGraph graph, PgxVertex<ID> src, VertexSequence<ID> nodeSeq, EdgeSequence edgeSeq) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Find cycle looks for any loop in the graph.
Definition
This implementation tries to find a cycle in a directed graph using the given vertex as starting point for the DFS traversal and will return the first cycle found, if there is one. In such case, the vertices and edges involved in the cycle will be returned in the order of visit. Restricting the DFS traversal to a single starting point means that some parts of the graph may not get explored.
Implementation Details
The implementation of this algorithm uses a built-in DFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(4 * V + E) with V = number of vertices, E = number of edges
Default Values
- s: 0
Applications
- Cycles in a graph can be useful in problems related to routes and flows.
- Parameters:
graph
- the graph.src
- source vertex for the search.nodeSeq
- (out argument) vertex sequence holding the vertices in the cycle.edgeSeq
- (out argument) edge sequence holding the edges in the cycle.- Returns:
- PgxPath representing the cycle as path, if exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexSequence<Integer> nodeSeq = graph.createVertexSequence(); EdgeSequence edgeSeq = graph.createEdgeSequence(); PgxPath<Integer> cycle = analyst.findCycle(graph, vertex, nodeSeq, edgeSeq); cycle.getPathLengthWithCost();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
reachability
public <ID> java.lang.Integer reachability(PgxGraph graph, PgxVertex<ID> source, PgxVertex<ID> dest, int maxHops, boolean ignoreEdgeDirection) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Reachability is a fast way to check if two vertices are reachable from each other.
Definition
This algorithm tries to find if the destination vertex is reachable given the source vertex and the maximum hop distance set by the user. The search can be performed in a directed or undirected way. These options may lead to different hop distances, since an undirected search has less restrictions on the possible paths connecting vertices than the directed option. Hence hop distances from an undirected search can be smaller than the ones from the directed cases.
Implementation Details
The implementation of this algorithm uses a built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(1)
Default Values
Applications
- Check connectivity between vertices in a graph.
- Parameters:
graph
- the graph.source
- source vertex for the search.dest
- destination vertex for the search.maxHops
- maximum hop distance between the source and destination vertices.ignoreEdgeDirection
- boolean flag for ignoring the direction of the edges during the search.- Returns:
- the number of hops between the vertices. It will return -1 if the vertices are not connected or are not reachable given the condition of the maximum hop distance allowed.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); integer result = analyst.reachability(graph, src, dst, 2, false);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
topologicalSort
public <ID> VertexProperty<ID,java.lang.Integer> topologicalSort(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Topological sort gives an order of visit for vertices in directed acyclic graphs
Definition
Topological sort tries to set an order over the vertices in a graph using the direction of the edges. A directed graph has a topological order if and only if it has no cycles, i.e. it is a directed acyclic graph. The algorithm visits the vertices in a DFS-like fashion to set up their order. The order of the vertices is returned as a vertex property, and the values will be set to -1 if there is a cycle in the graph.
Implementation Details
The implementation of this algorithm is sequential due the ordering constraint.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- This algorithm computes a basic structural graph property that is useful for tasks involving serialization and dependencies.
- Parameters:
graph
- the graph.- Returns:
- vertex property holding the topological order of each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Integer> topoSort = analyst.topologicalSort(graph); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + topoSort.getName() + " WHERE (x) ORDER BY x." + topoSort.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
topologicalSort
public <ID> VertexProperty<ID,java.lang.Integer> topologicalSort(PgxGraph graph, VertexProperty<ID,java.lang.Integer> topoSort) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Topological sort gives an order of visit for vertices in directed acyclic graphs
Definition
Topological sort tries to set an order over the vertices in a graph using the direction of the edges. A directed graph has a topological order if and only if it has no cycles, i.e. it is a directed acyclic graph. The algorithm visits the vertices in a DFS-like fashion to set up their order. The order of the vertices is returned as a vertex property, and the values will be set to -1 if there is a cycle in the graph.
Implementation Details
The implementation of this algorithm is sequential due the ordering constraint.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- This algorithm computes a basic structural graph property that is useful for tasks involving serialization and dependencies.
- Parameters:
graph
- the graph.topoSort
- (out argument) vertex property holding the topological order of each vertex.- Returns:
- vertex property holding the topological order of each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Integer> prop = graph.createVertexProperty(PropertyType.INTEGER); VertexProperty<Integer, Integer> topoSort = analyst.topologicalSort(graph, prop); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + topoSort.getName() + " WHERE (x) ORDER BY x." + topoSort.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
topologicalSchedule
public <ID> VertexProperty<ID,java.lang.Integer> topologicalSchedule(PgxGraph graph, VertexSet<ID> source) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Topological schedule gives an order of visit for the reachable vertices from the source
Definition
Topological schedule sets an order over the vertices in a graph based on the proximity these have to the vertices from the given source. The algorithm does a BFS traversal for each vertex from the source set in order to assign the correct scheduling order to all the reachable, even if the graph is undirected or has cycles. The vertices that are not reachable will be assigned a value of -1.
Implementation Details
The implementation of this algorithm uses a built-in BFS feature.
Complexity
- Time:
O(k * (V + E)) with V = number of vertices, E = number of edges, k = size of the source set
- Space:
O(V) with V = number of vertices
Default Values
Applications
- This algorithm computes a basic structural graph property that is useful for tasks involving serialization and dependencies.
- Parameters:
graph
- the graph.source
- set of vertices to be used as the starting points for the scheduling order.- Returns:
- vertex property holding the scheduled order of each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Integer> topoSched = analyst.topologicalSchedule(graph, source); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + topoSched.getName() + " WHERE (x) ORDER BY x." + topoSched.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
topologicalSchedule
public <ID> VertexProperty<ID,java.lang.Integer> topologicalSchedule(PgxGraph graph, VertexSet<ID> source, VertexProperty<ID,java.lang.Integer> topoSched) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Topological sort gives an order of visit for vertices in directed acyclic graphs
Definition
Topological sort tries to set an order over the vertices in a graph using the direction of the edges. A directed graph has a topological order if and only if it has no cycles, i.e. it is a directed acyclic graph. The algorithm visits the vertices in a DFS-like fashion to set up their order. The order of the vertices is returned as a vertex property, and the values will be set to -1 if there is a cycle in the graph.
Implementation Details
The implementation of this algorithm is sequential due the ordering constraint.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- This algorithm computes a basic structural graph property that is useful for tasks involving serialization and dependencies.
- Parameters:
graph
- the graph.source
- set of vertices to be used as the starting points for the scheduling order.topoSched
- (out argument) vertex property holding the scheduled order of each vertex.- Returns:
- vertex property holding the scheduled order of each vertex.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Integer> prop = graph.createVertexProperty(PropertyType.INTEGER); VertexProperty<Integer, Integer> topoSched = analyst.topologicalSchedule(graph, source, prop); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + topoSched.getName() + " WHERE (x) ORDER BY x." + topoSched.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
outDegreeDistribution
public PgxMap<java.lang.Integer,java.lang.Long> outDegreeDistribution(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Out-degree distribution gives information about the outgoing flows in a graph
Definition
This version of the degree distribution will return a map with the distribution of the out-degree (i.e. just outgoing edges) of the graph. For undirected graphs the algorithm will consider all the edges (incoming and outgoing) for the distribution.
Implementation Details
This algorithm runs in a sequential way. It uses a map with type int for the keys and type long for storing the mapped values of the distribution, like a histogram.
Complexity
- Time:
O(V) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Degree distribution is a basic structural property of a graph which can help to characterize and classify them.
- Parameters:
graph
- the graph.- Returns:
- map holding a histogram of the node degrees in the graph.
Examples
PgxGraph graph = ...; PgxMap<Integer, Long> degree = analyst.outDegreeDistribution(graph);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
outDegreeDistribution
public PgxMap<java.lang.Integer,java.lang.Long> outDegreeDistribution(PgxGraph graph, PgxMap<java.lang.Integer,java.lang.Long> distribution) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Out-degree distribution gives information about the outgoing flows in a graph
Definition
This version of the degree distribution will return a map with the distribution of the out-degree (i.e. just outgoing edges) of the graph. For undirected graphs the algorithm will consider all the edges (incoming and outgoing) for the distribution.
Implementation Details
This algorithm runs in a sequential way. It uses a map with type int for the keys and type long for storing the mapped values of the distribution, like a histogram.
Complexity
- Time:
O(V) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Degree distribution is a basic structural property of a graph which can help to characterize and classify them.
- Parameters:
graph
- the graph.distribution
- (out argument)- Returns:
- map holding a histogram of the node degrees in the graph.
Examples
PgxGraph graph = ...; PgxMap<Integer, Long> distribution = graph.createMap(PropertyType.INTEGER, PropertyType.LONG); PgxMap<Integer, Long> degree = analyst.outDegreeDistribution(graph, distribution);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
inDegreeDistribution
public PgxMap<java.lang.Integer,java.lang.Long> inDegreeDistribution(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
In-degree distribution gives information about the incoming flows in a graph
Definition
This version of the degree distribution will return a map with the distribution of the in-degree (i.e. just incoming edges) of the graph. For undirected graphs the algorithm will consider all the edges (incoming and outgoing) for the distribution.
Implementation Details
This algorithm runs in a sequential way. It uses a map with type int for the keys and type long for storing the mapped values of the distribution, like a histogram.
Complexity
- Time:
O(V) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Degree distribution is a basic structural property of a graph which can help to characterize and classify them.
- Parameters:
graph
- the graph.- Returns:
- map holding a histogram of the vertex degrees in the graph.
Examples
PgxGraph graph = ...; PgxMap<Integer, Long> degree = analyst.inDegreeDistribution(graph);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
inDegreeDistribution
public PgxMap<java.lang.Integer,java.lang.Long> inDegreeDistribution(PgxGraph graph, PgxMap<java.lang.Integer,java.lang.Long> distribution) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
In-degree distribution gives information about the incoming flows in a graph
Definition
This version of the degree distribution will return a map with the distribution of the in-degree (i.e. just incoming edges) of the graph. For undirected graphs the algorithm will consider all the edges (incoming and outgoing) for the distribution.
Implementation Details
This algorithm runs in a sequential way. It uses a map with type int for the keys and type long for storing the mapped values of the distribution, like a histogram.
Complexity
- Time:
O(V) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Degree distribution is a basic structural property of a graph which can help to characterize and classify them.
- Parameters:
graph
- the graph.distribution
- (out argument)- Returns:
- map holding a histogram of the vertex degrees in the graph.
Examples
PgxGraph graph = ...; PgxMap<Integer, Long> distribution = graph.createMap(PropertyType.INTEGER, PropertyType.LONG); PgxMap<Integer, Long> degree = analyst.inDegreeDistribution(graph, distribution);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
fattestPath
public <ID> AllPaths<ID> fattestPath(PgxGraph graph, PgxVertex<ID> root, EdgeProperty<java.lang.Double> capacity) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Fattest path is a fast algorithm for finding a shortest path adding constraints for flowing related matters
Definition
The Fattest path algorithm can be regarded as a variant of Dijkstra's algorithm, it tries to find the fattest path between the given source and all the reachable vertices in the graph. The fatness of a path is equal to the minimum value of the capacity from the edges that take part in the path, thus a fattest path is conformed by the edges with the largest possible capacity.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(4 * V) with V = number of vertices
Default Values
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.capacity
- edge property holding the capacity of each edge in the graph.- Returns:
- AllPaths holding the information of the possible fattest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> root = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); AllPaths<Integer> fattestPath = analyst.fattestPath(graph, root, cost);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
fattestPath
public <ID> AllPaths<ID> fattestPath(PgxGraph graph, PgxVertex<ID> root, EdgeProperty<java.lang.Double> capacity, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Fattest path is a fast algorithm for finding a shortest path adding constraints for flowing related matters
Definition
The Fattest path algorithm can be regarded as a variant of Dijkstra's algorithm, it tries to find the fattest path between the given source and all the reachable vertices in the graph. The fatness of a path is equal to the minimum value of the capacity from the edges that take part in the path, thus a fattest path is conformed by the edges with the largest possible capacity.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(4 * V) with V = number of vertices
Default Values
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.capacity
- edge property holding the capacity of each edge in the graph.distance
- (out argument) vertex property holding the capacity value of the fattest path up to the current vertex. The fatness value for the source vertex will be INF, while it will be 0 for all the vertices that are not reachable from the source.parent
- (out argument) vertex property holding the parent vertex of the each vertex in the fattest path.parentEdge
- (out argument) vertex property holding the edge ID linking the current vertex in the path with the previous vertex in the path.- Returns:
- AllPaths holding the information of the possible fattest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> root = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> distance = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); AllPaths<Integer> fattestPath = analyst.fattestPath(graph, root, cost, distance, parent, parentEdge);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
fattestPath
public <ID> AllPaths<ID> fattestPath(PgxGraph graph, PgxVertex<ID> root, EdgeProperty<java.lang.Double> capacity, boolean ignoreEdgeDirection) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Undirected Fattest path is variation of the fattest graph algorithm that ignores edge directions. for flowing related matters
Definition
The Fattest path algorithm can be regarded as a variant of Dijkstra's algorithm, it tries to find the fattest path between the given source and all the reachable vertices in the graph. The fatness of a path is equal to the minimum value of the capacity from the edges that take part in the path, thus a fattest path is conformed by the edges with the largest possible capacity.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(4 * V) with V = number of vertices
Default Values
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.capacity
- edge property holding the capacity of each edge in the graph.ignoreEdgeDirection
- boolean flag for ignoring the direction of the edges during the search.- Returns:
- AllPaths holding the information of the possible fattest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> root = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); AllPaths<Integer> fattestPath = analyst.fattestPath(graph, root, cost, true);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
fattestPath
public <ID> AllPaths<ID> fattestPath(PgxGraph graph, PgxVertex<ID> root, EdgeProperty<java.lang.Double> capacity, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge, boolean ignoreEdgeDirection) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Undirected Fattest path is variation of the fattest graph algorithm that ignores edge directions. for flowing related matters
Definition
The Fattest path algorithm can be regarded as a variant of Dijkstra's algorithm, it tries to find the fattest path between the given source and all the reachable vertices in the graph. The fatness of a path is equal to the minimum value of the capacity from the edges that take part in the path, thus a fattest path is conformed by the edges with the largest possible capacity.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(4 * V) with V = number of vertices
Default Values
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.capacity
- edge property holding the capacity of each edge in the graph.distance
- (out argument) vertex property holding the capacity value of the fattest path up to the current vertex. The fatness value for the source vertex will be INF, while it will be 0 for all the vertices that are not reachable from the source.parent
- (out argument) vertex property holding the parent vertex of the each vertex in the fattest path.parentEdge
- (out argument) vertex property holding the edge ID linking the current vertex in the path with the previous vertex in the path.ignoreEdgeDirection
- boolean flag for ignoring the direction of the edges during the search.- Returns:
- AllPaths holding the information of the possible fattest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> root = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> distance = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); AllPaths<Integer> fattestPath = analyst.fattestPath(graph, root, cost, distance, parent, parentEdge, true);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
sccKosaraju
public <ID> Partition<ID> sccKosaraju(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Kosaraju finds strongly connected components in a graph
Definition
Kosaraju's algorithm works on directed graphs for finding strongly connected components (SCC). A SCC is a maximal subset of vertices of the graph with the particular characteristic that every vertex in the SCC can be reachable from any other other vertex in the SCC.
Implementation Details
The implementation of this algorithm uses the built-in DFS and BFS features.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- It can be used for clustering and, in social networks, to spot out groups of people (communities), since people in groups tend to have a high density of links between them.
- Parameters:
graph
- the graph.- Returns:
- Partition holding the node collections corresponding to the components found by the algorithm.
Examples
PgxGraph graph = ...; Partition<Integer> scc = analyst.sccKosaraju(graph); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + scc.getPropertyName() + " MATCH (x) ORDER BY x." + scc.getPropertyName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
sccKosaraju
public <ID> Partition<ID> sccKosaraju(PgxGraph graph, VertexProperty<ID,java.lang.Long> partitionDistribution) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Kosaraju finds strongly connected components in a graph
Definition
Kosaraju's algorithm works on directed graphs for finding strongly connected components (SCC). A SCC is a maximal subset of vertices of the graph with the particular characteristic that every vertex in the SCC can be reachable from any other other vertex in the SCC.
Implementation Details
The implementation of this algorithm uses the built-in DFS and BFS features.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- It can be used for clustering and, in social networks, to spot out groups of people (communities), since people in groups tend to have a high density of links between them.
- Parameters:
graph
- the graph.partitionDistribution
- vertex property holding the label of the SCC assigned to each vertex.- Returns:
- Partition holding the node collections corresponding to the components found by the algorithm.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Long> pd = graph.createVertexProperty(PropertyType.LONG); Partition<Integer> scc = analyst.sccKosaraju(graph, pd); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + scc.getPropertyName() + " MATCH (x) ORDER BY x." + scc.getPropertyName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
sccTarjan
public <ID> Partition<ID> sccTarjan(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Tarjan finds strongly connected components in a graph
Definition
Tarjan's algorithm works on directed graphs for finding strongly connected components (SCC). A SCC is a maximal subset of vertices of the graph with the particular characteristic that every vertex in the SCC can be reachable from any other other vertex in the SCC.
Implementation Details
The implementation of this algorithm uses the built-in DFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(5 * V) with V = number of vertices
Default Values
Applications
- It can be used for clustering and, in social networks, to spot out groups of people (communities), since people in groups tend to have a high density of links between them.
- Parameters:
graph
- the graph.- Returns:
- Partition holding the node collections corresponding to the components found by the algorithm.
Examples
PgxGraph graph = ...; Partition<Integer> scc = analyst.sccTarjan(graph); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + scc.getPropertyName() + " MATCH (x) ORDER BY x." + scc.getPropertyName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
sccTarjan
public <ID> Partition<ID> sccTarjan(PgxGraph graph, VertexProperty<ID,java.lang.Long> partitionDistribution) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Tarjan finds strongly connected components in a graph
Definition
Tarjan's algorithm works on directed graphs for finding strongly connected components (SCC). A SCC is a maximal subset of vertices of the graph with the particular characteristic that every vertex in the SCC can be reachable from any other other vertex in the SCC.
Implementation Details
The implementation of this algorithm uses the built-in DFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(5 * V) with V = number of vertices
Default Values
Applications
- It can be used for clustering and, in social networks, to spot out groups of people (communities), since people in groups tend to have a high density of links between them.
- Parameters:
graph
- the graph.partitionDistribution
- vertex property holding the label of the SCC assigned to each vertex.- Returns:
- Partition holding the node collections corresponding to the components found by the algorithm.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Long> pd = graph.createVertexProperty(PropertyType.LONG); Partition<Integer> scc = analyst.sccTarjan(graph, pd); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + scc.getPropertyName() + " MATCH (x) ORDER BY x." + scc.getPropertyName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
wcc
public <ID> Partition<ID> wcc(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Identifying weakly connected components can be useful for clustering graph data
Definition
This algorithm finds weakly connected components (WCC) in a directed graph. A WCC is a maximal subset of vertices of the graph with the particular characteristic that for every pair of vertices U and V in the WCC there must be a path connecting U to V, ignoring the direction of edges. It is a non-deterministic algorithm because of its parallelized implementation.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(E * d) with d = diameter of the graph
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It can be used for clustering and analysis in social networks.
- Parameters:
graph
- the graph.- Returns:
- Partition holding the node collections corresponding to the components found by the algorithm.
Examples
PgxGraph graph = ...; Partition<Integer> wcc = analyst.wcc(graph); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + wcc.getPropertyName() + " MATCH (x) ORDER BY x." + wcc.getPropertyName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- Connectivity "("graph theory")"
- Time:
-
wcc
public <ID> Partition<ID> wcc(PgxGraph graph, VertexProperty<ID,java.lang.Long> partitionDistribution) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Identifying weakly connected components can be useful for clustering graph data
Definition
This algorithm finds weakly connected components (WCC) in a directed graph. A WCC is a maximal subset of vertices of the graph with the particular characteristic that for every pair of vertices U and V in the WCC there must be a path connecting U to V, ignoring the direction of edges. It is a non-deterministic algorithm because of its parallelized implementation.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(E * d) with d = diameter of the graph
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- It can be used for clustering and analysis in social networks.
- Parameters:
graph
- the graph.partitionDistribution
- vertex property holding the label of the WCC assigned to each vertex.- Returns:
- Partition holding the node collections corresponding to the components found by the algorithm.
Examples
PgxGraph graph = ...; VertexProperty<Integer, Long> pd = graph.createVertexProperty(PropertyType.LONG); Partition<Integer> wcc = analyst.wcc(graph, pd); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + wcc.getPropertyName() + " MATCH (x) ORDER BY x." + wcc.getPropertyName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- Connectivity "("graph theory")"
- Time:
-
shortestPathDijkstra
public <ID> PgxPath<ID> shortestPathDijkstra(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Dijkstra is a fast algorithm for finding a shortest path in a graph
Definition
Dijkstra's algorithm tries to find the shortest path (if there is one) between the given source and destination vertices, while minimizing the distance or cost associated to each edge in the graph.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(4 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
- the graph.src
- the source vertex from the graph for the path.dst
- the destination vertex from the graph for the path.cost
- edge property holding the (positive) weight of each edge in the graph.- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxPath<Integer> path = analyst.shortestPathDijkstra(graph, src, dst, cost); path.getPathLengthWithCost();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
shortestPathDijkstra
public <ID> PgxPath<ID> shortestPathDijkstra(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Dijkstra is a fast algorithm for finding a shortest path in a graph
Definition
Dijkstra's algorithm tries to find the shortest path (if there is one) between the given source and destination vertices, while minimizing the distance or cost associated to each edge in the graph.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(4 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
- the graph.src
- the source vertex from the graph for the path.dst
- the destination vertex from the graph for the path.cost
- edge property holding the (positive) weight of each edge in the graph.parent
- (out argument) vertex property holding the parent vertex of the each vertex in the shortest path.parentEdge
- (out argument) vertex property holding the edge ID linking the current vertex in the path with the previous vertex in the path.- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); PgxPath<Integer> path = analyst.shortestPathDijkstra(graph, src, dst, cost, parent, parentEdge); path.getPathLengthWithCost();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
shortestPathMultiDestinationDijkstra
public <ID> AllPaths<ID> shortestPathMultiDestinationDijkstra(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Dijkstra is a fast algorithm for finding a shortest path in a graph and goes to all destinations.
Definition
This variant of the Dijkstra's algorithm tries to find the shortest path (if there is one) which goes from a single source to all destinations, while minimizing the distance or cost associated to each edge in the graph.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(4 * V) with V = number of vertices
Default Values
- src: 0
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
- the graph.src
- the source vertex from the graph for the path.cost
- edge property holding the (positive) weight of each edge in the graph.- Returns:
- AllPaths holding the information of the possible shortest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); AllPaths<Integer> path = analyst.shortestPathMultiDestinationDijkstra(graph, src, cost);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
shortestPathMultiDestinationDijkstra
public <ID> AllPaths<ID> shortestPathMultiDestinationDijkstra(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Dijkstra is a fast algorithm for finding a shortest path in a graph and goes to all destinations.
Definition
This variant of the Dijkstra's algorithm tries to find the shortest path (if there is one) which goes from a single source to all destinations, while minimizing the distance or cost associated to each edge in the graph.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(4 * V) with V = number of vertices
Default Values
- src: 0
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
- the graph.src
- the source vertex from the graph for the path.cost
- edge property holding the (positive) weight of each edge in the graph.distance
- (out argument) vertex property holding the distance to the source vertex for each vertex in the graph.parent
- (out argument) vertex property holding the parent vertex of the each vertex in the shortest path.parentEdge
- (out argument) vertex property holding the edge ID linking the current vertex in the path with the previous vertex in the path.- Returns:
- AllPaths holding the information of the possible shortest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> distance = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); AllPaths<ID> promise = analyst.shortestPathMultiDestinationDijkstra(graph, src, cost, distance, parent, parentEdge);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
shortestPathFilteredDijkstra
public <ID> PgxPath<ID> shortestPathFilteredDijkstra(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Filtered Dijkstra is a fast algorithm for finding a shortest path while also filtering edges
Definition
This variant of the Dijkstra's algorithm tries to find the shortest path while also taking into account a filter expression, which will add restrictions over the potential edges when looking for the shortest path between the source and destination vertices.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(4 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
-src
-dst
-cost
-filterExpr
-- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); EdgeFilter filter = EdgeFilter.fromExpression("edge.cost > 5"); PgxPath<Integer> path = analyst.shortestPathFilteredDijkstra(graph, src, dst, cost, filter); path.getPathLengthWithCost();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
shortestPathFilteredDijkstra
public <ID> PgxPath<ID> shortestPathFilteredDijkstra(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Filtered Dijkstra is a fast algorithm for finding a shortest path while also filtering edges
Definition
This variant of the Dijkstra's algorithm tries to find the shortest path while also taking into account a filter expression, which will add restrictions over the potential edges when looking for the shortest path between the source and destination vertices.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(4 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
-src
-dst
-cost
-filterExpr
-parent
- (out argument)parentEdge
- (out argument)- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); EdgeFilter filter = EdgeFilter.fromExpression("edge.cost > 5"); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); PgxPath<Integer> path = analyst.shortestPathFilteredDijkstra(graph, src, dst, cost, filter, parent, parentEdge); path.getPathLengthWithCost();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
shortestPathFilteredDijkstra
public <ID> PgxPath<ID> shortestPathFilteredDijkstra(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, boolean ignoreEdgeDirection) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Undirected filtered djkstra is variation of the filtered djkstra's algorithm that ignores edge directions.
Definition
This variant of the Dijkstra's algorithm tries to find the shortest path ignoring edges directions for directed graphs while also taking into account a filter expression, which will add restrictions over the potential edges when looking for the shortest path between the source and destination vertices .
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(4 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
-src
-dst
-cost
-filterExpr
-ignoreEdgeDirection
- boolean flag for ignoring the direction of the edges- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); EdgeFilter filter = EdgeFilter.fromExpression("edge.cost > 5"); PgxPath<Integer> path = analyst.shortestPathFilteredDijkstra(graph, src, dst, cost, filter); path.getPathLengthWithCost();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
shortestPathFilteredDijkstra
public <ID> PgxPath<ID> shortestPathFilteredDijkstra(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge, boolean ignoreEdgeDirection) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Undirected filtered djkstra is variation of the filtered djkstra's algorithm that ignores edge directions.
Definition
This variant of the Dijkstra's algorithm tries to find the shortest path ignoring edges directions for directed graphs while also taking into account a filter expression, which will add restrictions over the potential edges when looking for the shortest path between the source and destination vertices .
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(4 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
-src
-dst
-cost
-filterExpr
-parent
- (out argument)parentEdge
- (out argument)ignoreEdgeDirection
- boolean flag for ignoring the direction of the edges- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); EdgeFilter filter = EdgeFilter.fromExpression("edge.cost > 5"); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); PgxPath<Integer> path = analyst.shortestPathFilteredDijkstra(graph, src, dst, cost, filter, parent, parentEdge); path.getPathLengthWithCost();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
shortestPathDijkstraBidirectional
public <ID> PgxPath<ID> shortestPathDijkstraBidirectional(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Bidirectional dijkstra is a fast algorithm for finding a shortest path in a graph
Definition
This variant of the Dijkstra's algorithm searches for shortest path in two ways, it does a forward search from the source vertex and a backwards one from the destination vertex. If the path between the vertices exists, both searches will meet each other at an intermediate point.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(10 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
-src
-dst
-cost
-- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxPath<Integer> path = analyst.shortestPathDijkstraBidirectional(graph, src, dst, cost); path.getPathLengthWithCost();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
shortestPathDijkstraBidirectional
public <ID> PgxPath<ID> shortestPathDijkstraBidirectional(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Bidirectional dijkstra is a fast algorithm for finding a shortest path in a graph
Definition
This variant of the Dijkstra's algorithm searches for shortest path in two ways, it does a forward search from the source vertex and a backwards one from the destination vertex. If the path between the vertices exists, both searches will meet each other at an intermediate point.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(10 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
-src
-dst
-cost
-parent
- (out argument)parentEdge
- (out argument)- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); PgxPath<Integer> path = analyst.shortestPathDijkstraBidirectional(graph, src, dst, cost, parent, parentEdge); path.getPathLengthWithCost();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
shortestPathDijkstraBidirectional
public <ID> PgxPath<ID> shortestPathDijkstraBidirectional(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, boolean ignoreEdgeDirection) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Undirected bidirectional dijkstra is a variant of bidirectional dijkstra that ignores edge directions
Definition
This variant of the Dijkstra's algorithm searches for shortest path in two ways, it does a forward search from the source vertex and a backwards one from the destination vertex. If the path between the vertices exists, both searches will meet each other at an intermediate point.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(10 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
-src
-dst
-cost
-ignoreEdgeDirection
- boolean flag for ignoring the direction of the edges during the search.- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxPath<Integer> path = analyst.shortestPathDijkstraBidirectional(graph, src, dst, cost); path.getPathLengthWithCost();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
shortestPathDijkstraBidirectional
public <ID> PgxPath<ID> shortestPathDijkstraBidirectional(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge, boolean ignoreEdgeDirection) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Undirected bidirectional dijkstra is a variant of bidirectional dijkstra that ignores edge directions
Definition
This variant of the Dijkstra's algorithm searches for shortest path in two ways, it does a forward search from the source vertex and a backwards one from the destination vertex. If the path between the vertices exists, both searches will meet each other at an intermediate point.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(10 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
-src
-dst
-cost
-parent
- (out argument)parentEdge
- (out argument)ignoreEdgeDirection
- boolean flag for ignoring the direction of the edges during the search.- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); PgxPath<Integer> path = analyst.shortestPathDijkstraBidirectional(graph, src, dst, cost, parent, parentEdge); path.getPathLengthWithCost();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
shortestPathDijkstra
public <ID> PgxPath<ID> shortestPathDijkstra(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, boolean ignoreEdgeDirection) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Undirected Dijkstra's algorithm is a variant of Dijkstra's algorithm that ignores edge directions.
Definition
Dijkstra's algorithm tries to find the shortest path (if there is one) between the given source and destination vertices, while minimizing the distance or cost associated to each edge in the graph.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(4 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
- the graph.src
- the source vertex from the graph for the path.dst
- the destination vertex from the graph for the path.cost
- edge property holding the (positive) weight of each edge in the graph.ignoreEdgeDirection
- boolean flag for ignoring the direction of the edges during the search.- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); PgxPath<Integer> path = analyst.shortestPathDijkstra(graph, src, dst, cost); path.getPathLengthWithCost();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
shortestPathDijkstra
public <ID> PgxPath<ID> shortestPathDijkstra(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge, boolean ignoreEdgeDirection) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Undirected Dijkstra's algorithm is a variant of Dijkstra's algorithm that ignores edge directions.
Definition
Dijkstra's algorithm tries to find the shortest path (if there is one) between the given source and destination vertices, while minimizing the distance or cost associated to each edge in the graph.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(4 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
- the graph.src
- the source vertex from the graph for the path.dst
- the destination vertex from the graph for the path.cost
- edge property holding the (positive) weight of each edge in the graph.parent
- (out argument) vertex property holding the parent vertex of the each vertex in the shortest path.parentEdge
- (out argument) vertex property holding the edge ID linking the current vertex in the path with the previous vertex in the path.ignoreEdgeDirection
- boolean flag for ignoring the direction of the edges during the search.- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); PgxPath<Integer> path = analyst.shortestPathDijkstra(graph, src, dst, cost, parent, parentEdge); path.getPathLengthWithCost();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
shortestPathFilteredDijkstraBidirectional
public <ID> PgxPath<ID> shortestPathFilteredDijkstraBidirectional(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Bidirectional dijkstra is a fast algorithm for finding a shortest path while also filtering edges
Definition
This variant of the Dijkstra's algorithm searches for shortest path in two ways, it does a forward search from the source vertex and a backwards one from the destination vertex, while also adding the corresponding restrictions on the edges given by the filter expression. If the path between the vertices exists, both searches will meet each other at an intermediate point.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(10 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
-src
-dst
-cost
-filterExpr
-- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); EdgeFilter filter = EdgeFilter.fromExpression("edge.cost > 5"); PgxPath<Integer> path = analyst.shortestPathFilteredDijkstraBidirectional(graph, src, dst, cost, filter); path.getPathLengthWithCost();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
shortestPathFilteredDijkstraBidirectional
public <ID> PgxPath<ID> shortestPathFilteredDijkstraBidirectional(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Bidirectional dijkstra is a fast algorithm for finding a shortest path while also filtering edges
Definition
This variant of the Dijkstra's algorithm searches for shortest path in two ways, it does a forward search from the source vertex and a backwards one from the destination vertex, while also adding the corresponding restrictions on the edges given by the filter expression. If the path between the vertices exists, both searches will meet each other at an intermediate point.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(10 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
-src
-dst
-cost
-filterExpr
-parent
- (out argument)parentEdge
- (out argument)- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); EdgeFilter filter = EdgeFilter.fromExpression("edge.cost > 5"); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); PgxPath<Integer> path = analyst.shortestPathFilteredDijkstraBidirectional( graph, src, dst, cost, filter, parent, parentEdge); path.getPathLengthWithCost();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
shortestPathFilteredDijkstraBidirectional
public <ID> PgxPath<ID> shortestPathFilteredDijkstraBidirectional(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, boolean ignoreEdgeDirection) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Bidirectional dijkstra is a fast algorithm for finding a shortest path while also filtering edges
Definition
This variant of the Dijkstra's algorithm searches for shortest path in two ways, it does a forward search from the source vertex and a backwards one from the destination vertex, while also adding the corresponding restrictions on the edges given by the filter expression. If the path between the vertices exists, both searches will meet each other at an intermediate point.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(10 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
-src
-dst
-cost
-filterExpr
-ignoreEdgeDirection
- boolean flag for ignoring the direction of the edges- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); EdgeFilter filter = EdgeFilter.fromExpression("edge.cost > 5"); PgxPath<Integer> path = analyst.shortestPathFilteredDijkstraBidirectional(graph, src, dst, cost, filter); path.getPathLengthWithCost();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
shortestPathFilteredDijkstraBidirectional
public <ID> PgxPath<ID> shortestPathFilteredDijkstraBidirectional(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge, boolean ignoreEdgeDirection) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Bidirectional dijkstra is a fast algorithm for finding a shortest path while also filtering edges
Definition
This variant of the Dijkstra's algorithm searches for shortest path in two ways, it does a forward search from the source vertex and a backwards one from the destination vertex, while also adding the corresponding restrictions on the edges given by the filter expression. If the path between the vertices exists, both searches will meet each other at an intermediate point.
Implementation Details
This algorithm runs in a sequential way.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(10 * V) with V = number of vertices
Default Values
- src: 0
- dst: 1000
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
-src
-dst
-cost
-filterExpr
-parent
- (out argument)parentEdge
- (out argument)ignoreEdgeDirection
- boolean flag for ignoring the direction of the edges- Returns:
- PgxPath holding the information of the shortest path, if it exists.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); PgxVertex<Integer> dst = graph.getVertex(333); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); EdgeFilter filter = EdgeFilter.fromExpression("edge.cost > 5"); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); PgxPath<Integer> path = analyst.shortestPathFilteredDijkstraBidirectional( graph, src, dst, cost, filter, parent, parentEdge); path.getPathLengthWithCost();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
shortestPathBellmanFord
public <ID> AllPaths<ID> shortestPathBellmanFord(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Bellman-ford finds multiple shortest paths at the same time
Definition
Bellman-Ford algorithm tries to find the shortest path (if there is one) between the given source and destination vertices, while minimizing the distance or cost associated to each edge in the graph.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(6 * V) with V = number of vertices
Default Values
- root: 0
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
- the graph.src
- the source vertex from the graph for the path.cost
- edge property holding the weight of each edge in the graph.- Returns:
- AllPaths holding the information of the possible shortest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); AllPaths<Integer> paths = analyst.shortestPathBellmanFord(graph, src, cost);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
shortestPathBellmanFord
public <ID> AllPaths<ID> shortestPathBellmanFord(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Bellman-ford finds multiple shortest paths at the same time
Definition
Bellman-Ford algorithm tries to find the shortest path (if there is one) between the given source and destination vertices, while minimizing the distance or cost associated to each edge in the graph.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(6 * V) with V = number of vertices
Default Values
- root: 0
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
- the graph.src
- the source vertex from the graph for the path.cost
- edge property holding the weight of each edge in the graph.distance
- (out argument) vertex property holding the distance to the source vertex for each vertex in the graph.parent
- (out argument) vertex property holding the parent vertex of the each vertex in the shortest path.parentEdge
- (out argument) vertex property holding the edge ID linking the current vertex in the path with the previous vertex in the path.- Returns:
- AllPaths holding the information of the possible shortest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> distance = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); AllPaths<Integer> paths = analyst.shortestPathBellmanFord(graph, src, cost, distance, parent, parentEdge);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
shortestPathBellmanFord
public <ID> AllPaths<ID> shortestPathBellmanFord(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost, boolean ignoreEdgeDirection) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Bellman-ford finds multiple shortest paths at the same time
Definition
Bellman-Ford algorithm tries to find the shortest path (if there is one) between the given source and destination vertices, while minimizing the distance or cost associated to each edge in the graph.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(6 * V) with V = number of vertices
Default Values
- root: 0
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
- the graph.src
- the source vertex from the graph for the path.cost
- edge property holding the weight of each edge in the graph.- Returns:
- AllPaths holding the information of the possible shortest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); AllPaths<Integer> paths = analyst.shortestPathBellmanFord(graph, src, cost, true);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
shortestPathBellmanFord
public <ID> AllPaths<ID> shortestPathBellmanFord(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge, boolean ignoreEdgeDirection) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Bellman-ford finds multiple shortest paths at the same time
Definition
Bellman-Ford algorithm tries to find the shortest path (if there is one) between the given source and destination vertices, while minimizing the distance or cost associated to each edge in the graph.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(6 * V) with V = number of vertices
Default Values
- root: 0
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
- the graph.src
- the source vertex from the graph for the path.cost
- edge property holding the weight of each edge in the graph.distance
- (out argument) vertex property holding the distance to the source vertex for each vertex in the graph.parent
- (out argument) vertex property holding the parent vertex of the each vertex in the shortest path.parentEdge
- (out argument) vertex property holding the edge ID linking the current vertex in the path with the previous vertex in the path.- Returns:
- AllPaths holding the information of the possible shortest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> distance = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); AllPaths<Integer> paths = analyst.shortestPathBellmanFord(graph, src, cost, distance, parent, parentEdge, true);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
shortestPathBellmanFordReverse
public <ID> AllPaths<ID> shortestPathBellmanFordReverse(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Reversed bellman-ford finds multiple shortest paths at the same time
Definition
This variant of the Bellman-Ford algorithm tries to find the shortest path (if there is one) between the given source and destination vertices in a reversed fashion using the incoming edges instead of the outgoing, while minimizing the distance or cost associated to each edge in the graph.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(6 * V) with V = number of vertices
Default Values
- root: 0
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
-src
-cost
-- Returns:
- AllPaths holding the information of the possible shortest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); AllPaths<Integer> paths = analyst.shortestPathBellmanFordReverse(graph, src, cost);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
shortestPathBellmanFordReverse
public <ID> AllPaths<ID> shortestPathBellmanFordReverse(PgxGraph graph, PgxVertex<ID> src, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Reversed bellman-ford finds multiple shortest paths at the same time
Definition
This variant of the Bellman-Ford algorithm tries to find the shortest path (if there is one) between the given source and destination vertices in a reversed fashion using the incoming edges instead of the outgoing, while minimizing the distance or cost associated to each edge in the graph.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(6 * V) with V = number of vertices
Default Values
- root: 0
Applications
- This algorithm can be implemented in optimization problems that can be represented with a graph structure.
- Parameters:
graph
-src
-cost
-distance
- (out argument)parent
- (out argument)parentEdge
- (out argument)- Returns:
- AllPaths holding the information of the possible shortest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, Double> distance = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); AllPaths<Integer> paths = analyst.shortestPathBellmanFordReverse(graph, src, cost, distance, parent, parentEdge);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
shortestPathHopDist
public <ID> AllPaths<ID> shortestPathHopDist(PgxGraph graph, PgxVertex<ID> src) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Hop distance can give a relatively fast insight on the distances in a graph
Definition
The Hop distance of two vertices S and V in a graph is the number of edges that are in a shortest path connecting them. This algorithm will return the distance of each vertex with respect to the given source vertex in the input and will also return the parent vertex and linking edge for each vertex. The returned information allows to trace back shortest paths from any reachable vertex to the source vertex.
Implementation Details
The implementation of this algorithm uses the built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- This algorithm computes a basic structural graph property that is useful when looking for distances in a graph.
- Parameters:
graph
-src
-- Returns:
- AllPaths holding the information of the possible shortest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); AllPaths<Integer> paths = analyst.shortestPathHopDist(graph, src);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
shortestPathHopDist
public <ID> AllPaths<ID> shortestPathHopDist(PgxGraph graph, PgxVertex<ID> src, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Hop distance can give a relatively fast insight on the distances in a graph
Definition
The Hop distance of two vertices S and V in a graph is the number of edges that are in a shortest path connecting them. This algorithm will return the distance of each vertex with respect to the given source vertex in the input and will also return the parent vertex and linking edge for each vertex. The returned information allows to trace back shortest paths from any reachable vertex to the source vertex.
Implementation Details
The implementation of this algorithm uses the built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- This algorithm computes a basic structural graph property that is useful when looking for distances in a graph.
- Parameters:
graph
-src
-distance
- (out argument)parent
- (out argument)parentEdge
- (out argument)- Returns:
- AllPaths holding the information of the possible shortest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); VertexProperty<Integer, Double> distance = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); AllPaths<Integer> paths = analyst.shortestPathHopDist(graph, src, distance, parent, parentEdge);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
shortestPathHopDistReverse
public <ID> AllPaths<ID> shortestPathHopDistReverse(PgxGraph graph, PgxVertex<ID> src) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Backwards hop distance can give a relatively fast insight on the distances in a graph
Definition
The Hop distance of two vertices S and V in a graph is the number of edges that are in a shortest path connecting them. This algorithm will return the distance of each node with respect to the given source node in the input and will also return the parent node and linking edge for each node. The returned information allows to trace back shortest paths from any reachable node to the source node.
Implementation Details
The implementation of this algorithm uses the built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- This algorithm computes a basic structural graph property that is useful when looking for distances in a graph.
- Parameters:
graph
-src
-- Returns:
- AllPaths holding the information of the possible shortest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); AllPaths<Integer> paths = analyst.shortestPathHopDistReverse(graph, src);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
shortestPathHopDistReverse
public <ID> AllPaths<ID> shortestPathHopDistReverse(PgxGraph graph, PgxVertex<ID> src, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Backwards hop distance can give a relatively fast insight on the distances in a graph
Definition
The Hop distance of two vertices S and V in a graph is the number of edges that are in a shortest path connecting them. This algorithm will return the distance of each node with respect to the given source node in the input and will also return the parent node and linking edge for each node. The returned information allows to trace back shortest paths from any reachable node to the source node.
Implementation Details
The implementation of this algorithm uses the built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- This algorithm computes a basic structural graph property that is useful when looking for distances in a graph.
- Parameters:
graph
-src
-distance
- (out argument)parent
- (out argument)parentEdge
- (out argument)- Returns:
- AllPaths holding the information of the possible shortest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); VertexProperty<Integer, Double> distance = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); AllPaths<Integer> paths = analyst.shortestPathHopDistReverse(graph, src, distance, parent, parentEdge);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
shortestPathHopDistUndirected
public <ID> AllPaths<ID> shortestPathHopDistUndirected(PgxGraph graph, PgxVertex<ID> src) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Undirected hop distance can give a relatively fast insight on the distances in a graph
Definition
The Hop distance of two vertices S and V in a graph is the number of edges that are in a shortest path connecting them. This algorithm will return the distance of each node with respect to the given source node in the input and will also return the parent node and linking edge for each node. The returned information allows to trace back shortest paths from any reachable node to the source node.
Implementation Details
The implementation of this algorithm uses the built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- This algorithm computes a basic structural graph property that is useful when looking for distances in a graph.
- Parameters:
graph
-src
-- Returns:
- AllPaths holding the information of the possible shortest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); AllPaths<Integer> paths = analyst.shortestPathHopDistUndirected(graph, src);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
shortestPathHopDistUndirected
public <ID> AllPaths<ID> shortestPathHopDistUndirected(PgxGraph graph, PgxVertex<ID> src, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Undirected hop distance can give a relatively fast insight on the distances in a graph
Definition
The Hop distance of two vertices S and V in a graph is the number of edges that are in a shortest path connecting them. This algorithm will return the distance of each node with respect to the given source node in the input and will also return the parent node and linking edge for each node. The returned information allows to trace back shortest paths from any reachable node to the source node.
Implementation Details
The implementation of this algorithm uses the built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- This algorithm computes a basic structural graph property that is useful when looking for distances in a graph.
- Parameters:
graph
-src
-distance
- (out argument)parent
- (out argument)parentEdge
- (out argument)- Returns:
- AllPaths holding the information of the possible shortest paths from the source node.
Examples
PgxGraph graph = ...; PgxVertex<Integer> src = graph.getVertex(128); VertexProperty<Integer, Double> distance = graph.createVertexProperty(PropertyType.DOUBLE); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); VertexProperty<Integer, PgxEdge> parentEdge = graph.createVertexProperty(PropertyType.EDGE); AllPaths<Integer> paths = analyst.shortestPathHopDistUndirected(graph, src, distance, parent, parentEdge);
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
matrixFactorizationGradientDescent
public <ID> MatrixFactorizationModel<ID> matrixFactorizationGradientDescent(BipartiteGraph graph, EdgeProperty<java.lang.Double> weight) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
Matrix factorization can be used as a recommendation algorithm for bipartite graphs
Definition
This algorithm needs a [bipartite](prog-guides/mutation-subgraph/subgraph.html#create-a-bipartite-subgraph-based-on-a-vertex-list) graph to generate feature vectors that factorize the given set of left vertices (users) and right vertices (items), so that the inner product of such feature vectors can recover the information from the original graph structure, which can be seen as a sparse matrix. The generated feature vectors can be used for making recommendations with the given set of users, where a good recommendation for a given user will be a dot (inner) product between the feature vector of the user and the corresponding feature vector of a vertex from the item set, such that the result of that dot product returns a high score.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(E * k * s) with E = number of edges, k = maximum number of iteration, s = size of the feature vectors
- Space:
O(2 * V * s) with V = number of vertices, s = size of the feature vectors
Default Values
Applications
- This algorithm can be used to get recommendations. The computed feature vectors can also be used to make predictions.
- Parameters:
graph
- Bipartite graph.weight
- edge property holding the rating weight of each edge in the graph. The weight needs to be pre-scaled into the range 1-5. If the weight values are not between 1 and 5, the result will become inaccurate.- Returns:
- Matrix factorization model holding the feature vectores found by the algorithm.
Examples
PgxGraph graph = ...; EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); MatrixFactorizationModel<Integer> matrix = analyst.matrixFactorizationGradientDescent(graph, cost); matrix.getRootMeanSquareError();
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
- See Also:
- Matrix factorization techniques for recommender systems
- Time:
-
matrixFactorizationGradientDescent
public <ID> MatrixFactorizationModel<ID> matrixFactorizationGradientDescent(BipartiteGraph graph, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,PgxVect<java.lang.Double>> features) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
Matrix factorization can be used as a recommendation algorithm for bipartite graphs
Definition
This algorithm needs a [bipartite](prog-guides/mutation-subgraph/subgraph.html#create-a-bipartite-subgraph-based-on-a-vertex-list) graph to generate feature vectors that factorize the given set of left vertices (users) and right vertices (items), so that the inner product of such feature vectors can recover the information from the original graph structure, which can be seen as a sparse matrix. The generated feature vectors can be used for making recommendations with the given set of users, where a good recommendation for a given user will be a dot (inner) product between the feature vector of the user and the corresponding feature vector of a vertex from the item set, such that the result of that dot product returns a high score.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(E * k * s) with E = number of edges, k = maximum number of iteration, s = size of the feature vectors
- Space:
O(2 * V * s) with V = number of vertices, s = size of the feature vectors
Default Values
Applications
- This algorithm can be used to get recommendations. The computed feature vectors can also be used to make predictions.
- Parameters:
graph
- Bipartite graph.weight
- edge property holding the rating weight of each edge in the graph. The weight needs to be pre-scaled into the range 1-5. If the weight values are not between 1 and 5, the result will become inaccurate.features
- (out argument) vertex property holding the generated feature vectors for each vertex.- Returns:
- Matrix factorization model holding the feature vectores found by the algorithm.
Examples
PgxGraph graph = ...; EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, PgxVect<Double>> features = graph.createVertexVectorProperty(PropertyType.DOUBLE, 20); MatrixFactorizationModel<Integer> matrix = analyst.matrixFactorizationGradientDescent(graph, cost, features); matrix.getRootMeanSquareError();
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
- See Also:
- Matrix factorization techniques for recommender systems
- Time:
-
matrixFactorizationGradientDescent
public <ID> MatrixFactorizationModel<ID> matrixFactorizationGradientDescent(BipartiteGraph graph, EdgeProperty<java.lang.Double> weight, double learningRate, double changePerStep, double lambda, int maxStep, int vectorLength, VertexProperty<ID,PgxVect<java.lang.Double>> features) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
Matrix factorization can be used as a recommendation algorithm for bipartite graphs
Definition
This algorithm needs a [bipartite](prog-guides/mutation-subgraph/subgraph.html#create-a-bipartite-subgraph-based-on-a-vertex-list) graph to generate feature vectors that factorize the given set of left vertices (users) and right vertices (items), so that the inner product of such feature vectors can recover the information from the original graph structure, which can be seen as a sparse matrix. The generated feature vectors can be used for making recommendations with the given set of users, where a good recommendation for a given user will be a dot (inner) product between the feature vector of the user and the corresponding feature vector of a vertex from the item set, such that the result of that dot product returns a high score.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(E * k * s) with E = number of edges, k = maximum number of iteration, s = size of the feature vectors
- Space:
O(2 * V * s) with V = number of vertices, s = size of the feature vectors
Default Values
Applications
- This algorithm can be used to get recommendations. The computed feature vectors can also be used to make predictions.
- Parameters:
graph
- Bipartite graph.weight
- edge property holding the rating weight of each edge in the graph. The weight needs to be pre-scaled into the range 1-5. If the weight values are not between 1 and 5, the result will become inaccurate.learningRate
- learning rate for the optimization process.changePerStep
- parameter used to modulate the learning rate during the optimization process.lambda
- penalization parameter to avoid overfitting during optimization process.maxStep
- maximum number of iterations that will be performed.vectorLength
- size of the feature vectors to be generated for the factorization.features
- (out argument) vertex property holding the generated feature vectors for each vertex.- Returns:
- Matrix factorization model holding the feature vectores found by the algorithm.
Examples
PgxGraph graph = ...; EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); VertexProperty<Integer, PgxVect<Double>> features = graph.createVertexVectorProperty(PropertyType.DOUBLE, 20); MatrixFactorizationModel<Integer> matrix = analyst.matrixFactorizationGradientDescent( graph, cost, 0.1, 0.9, 0.1, 100, 20, features); matrix.getRootMeanSquareError();
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
- See Also:
- Matrix factorization techniques for recommender systems
- Time:
-
matrixFactorizationGradientDescent
public <ID> MatrixFactorizationModel<ID> matrixFactorizationGradientDescent(BipartiteGraph graph, EdgeProperty<java.lang.Double> weight, double learningRate, double changePerStep, double lambda, int maxStep, int vectorLength) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
Matrix factorization can be used as a recommendation algorithm for bipartite graphs
Definition
This algorithm needs a [bipartite](prog-guides/mutation-subgraph/subgraph.html#create-a-bipartite-subgraph-based-on-a-vertex-list) graph to generate feature vectors that factorize the given set of left vertices (users) and right vertices (items), so that the inner product of such feature vectors can recover the information from the original graph structure, which can be seen as a sparse matrix. The generated feature vectors can be used for making recommendations with the given set of users, where a good recommendation for a given user will be a dot (inner) product between the feature vector of the user and the corresponding feature vector of a vertex from the item set, such that the result of that dot product returns a high score.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(E * k * s) with E = number of edges, k = maximum number of iteration, s = size of the feature vectors
- Space:
O(2 * V * s) with V = number of vertices, s = size of the feature vectors
Default Values
Applications
- This algorithm can be used to get recommendations. The computed feature vectors can also be used to make predictions.
- Parameters:
graph
- Bipartite graph.weight
- edge property holding the rating weight of each edge in the graph. The weight needs to be pre-scaled into the range 1-5. If the weight values are not between 1 and 5, the result will become inaccurate.learningRate
- learning rate for the optimization process.changePerStep
- parameter used to modulate the learning rate during the optimization process.lambda
- penalization parameter to avoid overfitting during optimization process.maxStep
- maximum number of iterations that will be performed.vectorLength
- size of the feature vectors to be generated for the factorization.- Returns:
- Matrix factorization model holding the feature vectores found by the algorithm.
Examples
PgxGraph graph = ...; EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); MatrixFactorizationModel<Integer> matrix = analyst.matrixFactorizationGradientDescent( graph, cost, 0.1, 0.9, 0.1, 100, 20); matrix.getRootMeanSquareError();
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
- See Also:
- Matrix factorization techniques for recommender systems
- Time:
-
matrixFactorizationRecommendations
public <ID> VertexProperty<ID,java.lang.Double> matrixFactorizationRecommendations(BipartiteGraph graph, PgxVertex<ID> user, int vectorLength, VertexProperty<ID,PgxVect<java.lang.Double>> feature, VertexProperty<ID,java.lang.Double> estimatedRating) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
Estimate rating can be used as a prediction algorithm for bipartite graphs
Definition
This algorithm is a complement for Matrix Factorization, thus it needs a bipartite graph and the generated feature vectors from such algorithm. The generated feature vectors will be used for making predictions in cases where the given user vertex has not been related to a particular item from the item set. Similarly to the recommendations from matrix factorization, this algorithm will perform dot products between the given user vertex and the rest of vertices in the graph, giving a score of 0 to the items that are already related to the user and to the products with other user vertices, hence returning the results of the dot products for the unrelated item vertices. The scores from those dot products can be interpreted as the predicted scores for the unrelated items given a particular user vertex.
Implementation Details
This algorithm is designed to run in parallel given its high degree of parallelization.
Complexity
- Time:
O(V) with V = number of vertices
- Space:
O(V) with V = number of vertices
Default Values
Applications
- This algorithm uses computed feature vectors from Matrix Factorization to make predictions about unrelated vertices from the item set (right vertices in the bipartite graph.
- Parameters:
graph
- Bipartite graph.user
- vertex from the left (user) side of the graph.vectorLength
- size of the feature vectors.feature
- vertex property holding the feature vectors for each vertex.estimatedRating
- (out argument) vertex property holding the estimated rating score for each vertex.- Returns:
- vertex property holding the estimated rating score for each vertex.
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
- See Also:
- Matrix factorization techniques for recommender systems
- Time:
-
prim
public EdgeProperty<java.lang.Boolean> prim(PgxGraph graph, EdgeProperty<java.lang.Double> weight) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
prim reveals tree structures with shortest paths in a graph
Definition
This implementation of Prim's algorithm works on undirected graphs that are connected and have no multi-edges (i.e. more than one edge connecting the same pair of vertices). The algorithm computes the minimum spanning tree (MST) of the graph using the weights associated to each edge. A minimum spanning tree is a subset of the edges that connects all the vertices in the graph such that it minimizes the total weight associated to the edges.
Implementation Details
The implementation of this algorithm uses an iterative method.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(2 * E + V) with V = number of vertices, E = number of edges
Default Values
Applications
- The trees found with Prim's algorithm can be used to simplify the design of networks when just looking to connect all the elements on the network, like in computer or transportation networks. It can also be used to generate mazes using the structure of a graph.
- Parameters:
graph
- the graph.weight
- edge property holding the weight of each edge in the graph.- Returns:
- edge property holding the edges belonging to the minimum spanning tree of the graph (i.e. all the edges with in_mst=true).
Examples
PgxGraph graph = ...; EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); EdgeProperty<Boolean> prim = analyst.prim(graph, cost); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + prim.getName() + " MATCH (x) ORDER BY x." + prim.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
prim
public EdgeProperty<java.lang.Boolean> prim(PgxGraph graph, EdgeProperty<java.lang.Double> weight, EdgeProperty<java.lang.Boolean> mst) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
prim reveals tree structures with shortest paths in a graph
Definition
This implementation of Prim's algorithm works on undirected graphs that are connected and have no multi-edges (i.e. more than one edge connecting the same pair of vertices). The algorithm computes the minimum spanning tree (MST) of the graph using the weights associated to each edge. A minimum spanning tree is a subset of the edges that connects all the vertices in the graph such that it minimizes the total weight associated to the edges.
Implementation Details
The implementation of this algorithm uses an iterative method.
Complexity
- Time:
O(E + V log V) with V = number of vertices, E = number of edges
- Space:
O(2 * E + V) with V = number of vertices, E = number of edges
Default Values
Applications
- The trees found with Prim's algorithm can be used to simplify the design of networks when just looking to connect all the elements on the network, like in computer or transportation networks. It can also be used to generate mazes using the structure of a graph.
- Parameters:
graph
- the graph.weight
- edge property holding the weight of each edge in the graph.mst
- (out argument) edge property holding the edges belonging to the minimum spanning tree of the graph (i.e. all the edges with in_mst=true).- Returns:
- edge property holding the edges belonging to the minimum spanning tree of the graph (i.e. all the edges with in_mst=true).
Examples
PgxGraph graph = ...; EdgeProperty<Double> cost = graph.getEdgeProperty("cost"); EdgeProperty<Boolean> mst = graph.createEdgeProperty(PropertyType.BOOLEAN); EdgeProperty<Boolean> prim = analyst.prim(graph, cost, mst); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + prim.getName() + " MATCH (x) ORDER BY x." + prim.getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
filteredBfs
public <ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>> filteredBfs(PgxGraph graph, PgxVertex<ID> root) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the BFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using BFS.
- You can use BFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>> bfs = analyst.filteredBfs(graph, vertex); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + bfs.getFirst().getName() + ", x." + bfs.getSecond().getName() + " MATCH (x) ORDER BY x." + bfs.getFirst().getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- Breadth-first search
- Time:
-
filteredBfs
public <ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>> filteredBfs(PgxGraph graph, PgxVertex<ID> root, int maxDepth) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the BFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using BFS.
- You can use BFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.maxDepth
- maximum depth limit for the BFS traversal.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>> bfs = analyst.filteredBfs(graph, vertex, 2); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + bfs.getFirst().getName() + ", x." + bfs.getSecond().getName() + " MATCH (x) ORDER BY x." + bfs.getFirst().getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- Breadth-first search
- Time:
-
filteredBfs
public <ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>> filteredBfs(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the BFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using BFS.
- You can use BFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.navigator
- navigator expression to be evaluated on the vertices during the graph traversal.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexFilter navigator = VertexFilter.ALL; Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>> bfs = analyst.filteredBfs(graph, vertex, navigator); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + bfs.getFirst().getName() + ", x." + bfs.getSecond().getName() + " MATCH (x) ORDER BY x." + bfs.getFirst().getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Since:
- 20.1.0
- See Also:
- Breadth-first search
- Time:
-
filteredBfs
public <ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>> filteredBfs(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, int maxDepth) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the BFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using BFS.
- You can use BFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.navigator
- navigator expression to be evaluated on the vertices during the graph traversal.maxDepth
- maximum depth limit for the BFS traversal.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexFilter navigator = VertexFilter.ALL; Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>> bfs = analyst.filteredBfs(graph, vertex, navigator, 2); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + bfs.getFirst().getName() + ", x." + bfs.getSecond().getName() + " MATCH (x) ORDER BY x." + bfs.getFirst().getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Since:
- 20.1.0
- See Also:
- Breadth-first search
- Time:
-
filteredBfs
public <ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>> filteredBfs(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the BFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using BFS.
- You can use BFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.navigator
- navigator expression to be evaluated on the vertices during the graph traversal.initWithInf
- boolean flag to set the initial distance values of the vertices. If set to true, it will initialize the distances as INF, and -1 otherwise.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexFilter navigator = VertexFilter.ALL; Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>> bfs = analyst.filteredBfs(graph, vertex, navigator, true); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + bfs.getFirst().getName() + ", x." + bfs.getSecond().getName() + " MATCH (x) ORDER BY x." + bfs.getFirst().getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Since:
- 20.1.0
- See Also:
- Breadth-first search
- Time:
-
filteredBfs
public <ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>> filteredBfs(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf, int maxDepth) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the BFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using BFS.
- You can use BFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.navigator
- navigator expression to be evaluated on the vertices during the graph traversal.initWithInf
- boolean flag to set the initial distance values of the vertices. If set to true, it will initialize the distances as INF, and -1 otherwise.maxDepth
- maximum depth limit for the BFS traversal.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexFilter navigator = VertexFilter.ALL; Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>> bfs = analyst.filteredBfs(graph, vertex, navigator, true, 2); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + bfs.getFirst().getName() + ", x." + bfs.getSecond().getName() + " MATCH (x) ORDER BY x." + bfs.getFirst().getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Since:
- 20.1.0
- See Also:
- Breadth-first search
- Time:
-
filteredBfs
public <ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>> filteredBfs(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf, VertexProperty<ID,java.lang.Integer> distance, VertexProperty<ID,PgxVertex<ID>> parent) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the BFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using BFS.
- You can use BFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.navigator
- navigator expression to be evaluated on the vertices during the graph traversal.initWithInf
- boolean flag to set the initial distance values of the vertices. If set to true, it will initialize the distances as INF, and -1 otherwise.distance
- (out argument) vertex property holding the hop distance for each reachable vertex in the graph.parent
- (out argument) vertex property holding the parent vertex of the each reachable vertex in the path.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexFilter navigator = VertexFilter.ALL; VertexProperty<Integer, Integer> distance = graph.createVertexProperty(PropertyType.INTEGER); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>> bfs = analyst.filteredBfs(graph, vertex, navigator, true, distance, parent); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + bfs.getFirst().getName() + ", x." + bfs.getSecond().getName() + " MATCH (x) ORDER BY x." + bfs.getFirst().getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Since:
- 20.1.0
- See Also:
- Breadth-first search
- Time:
-
filteredBfs
public <ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>> filteredBfs(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf, int maxDepth, VertexProperty<ID,java.lang.Integer> distance, VertexProperty<ID,PgxVertex<ID>> parent) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
A Breadth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the BFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in BFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(2 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using BFS.
- You can use BFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.navigator
- navigator expression to be evaluated on the vertices during the graph traversal.initWithInf
- boolean flag to set the initial distance values of the vertices. If set to true, it will initialize the distances as INF, and -1 otherwise.maxDepth
- maximum depth limit for the BFS traversal.distance
- (out argument) vertex property holding the hop distance for each reachable vertex in the graph.parent
- (out argument) vertex property holding the parent vertex of the each reachable vertex in the path.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexFilter navigator = VertexFilter.ALL; VertexProperty<Integer, Integer> distance = graph.createVertexProperty(PropertyType.INTEGER); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>> bfs = analyst.filteredBfs(graph, vertex, navigator, true, distance, parent); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + bfs.getFirst().getName() + ", x." + bfs.getSecond().getName() + " MATCH (x) ORDER BY x." + bfs.getFirst().getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Since:
- 20.1.0
- See Also:
- Breadth-first search
- Time:
-
filteredDfs
public <ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>> filteredDfs(PgxGraph graph, PgxVertex<ID> root) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the DFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in DFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using DFS.
- You can use DFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>> dfs = analyst.filteredDfs(graph, vertex); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + dfs.getFirst().getName() + ", x." + dfs.getSecond().getName() + " MATCH (x) ORDER BY x." + dfs.getFirst().getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- Depth-first search
- Time:
-
filteredDfs
public <ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>> filteredDfs(PgxGraph graph, PgxVertex<ID> root, int maxDepth) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the DFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in DFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using DFS.
- You can use DFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.maxDepth
- maximum depth limit for the BFS traversal.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>> dfs = analyst.filteredDfs(graph, vertex, 2); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + dfs.getFirst().getName() + ", x." + dfs.getSecond().getName() + " MATCH (x) ORDER BY x." + dfs.getFirst().getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
- Depth-first search
- Time:
-
filteredDfs
public <ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>> filteredDfs(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the DFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in DFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using DFS.
- You can use DFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.navigator
- navigator expression to be evaluated on the vertices during the graph traversal.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexFilter navigator = VertexFilter.ALL; Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>> dfs = analyst.filteredDfs(graph, vertex, navigator); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + dfs.getFirst().getName() + ", x." + dfs.getSecond().getName() + " MATCH (x) ORDER BY x." + dfs.getFirst().getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Since:
- 20.1.0
- See Also:
- Depth-first search
- Time:
-
filteredDfs
public <ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>> filteredDfs(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, int maxDepth) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the DFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in DFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using DFS.
- You can use DFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.navigator
- navigator expression to be evaluated on the vertices during the graph traversal.maxDepth
- maximum depth limit for the BFS traversal.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexFilter navigator = VertexFilter.ALL; Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>> dfs = analyst.filteredDfs(graph, vertex, navigator, 2); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + dfs.getFirst().getName() + ", x." + dfs.getSecond().getName() + " MATCH (x) ORDER BY x." + dfs.getFirst().getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Since:
- 20.1.0
- See Also:
- Depth-first search
- Time:
-
filteredDfs
public <ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>> filteredDfs(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the DFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in DFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using DFS.
- You can use DFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.navigator
- navigator expression to be evaluated on the vertices during the graph traversal.initWithInf
- boolean flag to set the initial distance values of the vertices. If set to true, it will initialize the distances as INF, and -1 otherwise.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexFilter navigator = VertexFilter.ALL; Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>> dfs = analyst.filteredDfs(graph, vertex, navigator, true); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + dfs.getFirst().getName() + ", x." + dfs.getSecond().getName() + " MATCH (x) ORDER BY x." + dfs.getFirst().getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Since:
- 20.1.0
- See Also:
- Depth-first search
- Time:
-
filteredDfs
public <ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>> filteredDfs(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf, int maxDepth) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the DFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in DFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using DFS.
- You can use DFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.navigator
- navigator expression to be evaluated on the vertices during the graph traversal.initWithInf
- boolean flag to set the initial distance values of the vertices. If set to true, it will initialize the distances as INF, and -1 otherwise.maxDepth
- maximum depth limit for the BFS traversal.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexFilter navigator = VertexFilter.ALL; Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>> dfs = analyst.filteredDfs(graph, vertex, navigator, true, 2); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + dfs.getFirst().getName() + ", x." + dfs.getSecond().getName() + " MATCH (x) ORDER BY x." + dfs.getFirst().getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Since:
- 20.1.0
- See Also:
- Depth-first search
- Time:
-
filteredDfs
public <ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>> filteredDfs(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf, VertexProperty<ID,java.lang.Integer> distance, VertexProperty<ID,PgxVertex<ID>> parent) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the DFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in DFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using DFS.
- You can use DFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.navigator
- navigator expression to be evaluated on the vertices during the graph traversal.initWithInf
- boolean flag to set the initial distance values of the vertices. If set to true, it will initialize the distances as INF, and -1 otherwise.distance
- (out argument) vertex property holding the hop distance for each reachable vertex in the graph.parent
- (out argument) vertex property holding the parent vertex of the each reachable vertex in the path.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexFilter navigator = VertexFilter.ALL; VertexProperty<Integer, Integer> distance = graph.createVertexProperty(PropertyType.INTEGER); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>> dfs = analyst.filteredDfs(graph, vertex, navigator, true, distance, parent); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + dfs.getFirst().getName() + ", x." + dfs.getSecond().getName() + " MATCH (x) ORDER BY x." + dfs.getFirst().getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Since:
- 20.1.0
- See Also:
- Depth-first search
- Time:
-
filteredDfs
public <ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>> filteredDfs(PgxGraph graph, PgxVertex<ID> root, VertexFilter navigator, boolean initWithInf, int maxDepth, VertexProperty<ID,java.lang.Integer> distance, VertexProperty<ID,PgxVertex<ID>> parent) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
A Depth-First Search implementation with an option to filter edges during the traversal of the graph.
Definition
This filtered version of the DFS algorithm allows to use a filter and a navigator expression to be evaluated over the vertices during the traversal and discriminate them according to the desired criteria. It will return the distance to the source vertex and the corresponding parent vertex for all the filtered vertices.
Implementation Details
The implementation of this algorithm uses the built-in DFS feature.
Complexity
- Time:
O(V + E) with V = number of vertices, E = number of edges
- Space:
O(3 * V) with V = number of vertices
Default Values
Applications
- In social networks, you can find people within a given distance from a person using DFS.
- You can use DFS to find if there is a path between two vertices.
- Parameters:
graph
- the graph.root
- the source vertex from the graph for the path.navigator
- navigator expression to be evaluated on the vertices during the graph traversal.initWithInf
- boolean flag to set the initial distance values of the vertices. If set to true, it will initialize the distances as INF, and -1 otherwise.maxDepth
- maximum depth limit for the BFS traversal.distance
- (out argument) vertex property holding the hop distance for each reachable vertex in the graph.parent
- (out argument) vertex property holding the parent vertex of the each reachable vertex in the path.- Returns:
- Pair holding first a node property with the hop distance for each reachable node in the graph and a second
node property with the parent node of each reachable node in the path.
Examples
PgxGraph graph = ...; PgxVertex<Integer> vertex = graph.getVertex(128); VertexFilter navigator = VertexFilter.ALL; VertexProperty<Integer, Integer> distance = graph.createVertexProperty(PropertyType.INTEGER); VertexProperty<Integer, PgxVertex<Integer>> parent = graph.createVertexProperty(PropertyType.VERTEX); Pair<VertexProperty<Integer, Integer>, VertexProperty<Integer, PgxVertex<Integer>>> dfs = analyst.filteredDfs(graph, vertex, navigator, true, distance, parent); PgqlResultSet rs = graph.queryPgql( "SELECT x, x." + dfs.getFirst().getName() + ", x." + dfs.getSecond().getName() + " MATCH (x) ORDER BY x." + dfs.getFirst().getName() + " DESC"); rs.print();
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Since:
- 20.1.0
- See Also:
- Depth-first search
- Time:
-
computeHighDegreeVertices
public <ID> Pair<PgxMap<java.lang.Integer,PgxVertex<ID>>,VertexSet<ID>> computeHighDegreeVertices(PgxGraph graph, int k, PgxMap<java.lang.Integer,PgxVertex<ID>> highDegreeVertexMapping, VertexSet<ID> highDegreeVertices) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Computes the k vertices with the highest degrees in the graph.
Definition
Computes the k vertices with the highest degrees in the graph. The resulting map will contain a mapping with the sorted index to the high-degree vertex with the index.
Implementation Details
null
Complexity
- Time:
O(N log N) with N = number of vertices
- Space:
O(k) with V = number of vertices
Default Values
Applications
- Can be used to compute the vertices with the highest degrees a.k.a. super-vertices. This information can be useful in certain applications.
- Parameters:
graph
- the graph.k
- number of high-degree vertices to be computed.highDegreeVertexMapping
- (out argument) the high-degree vertices.highDegreeVertices
- (out argument) the high-degree vertices.- Returns:
- Pair holding first a map with the top
k
high-degree vertices and their indices and a second vertex set containing the same vertices. - Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
computeHighDegreeVertices
public <ID> Pair<PgxMap<java.lang.Integer,PgxVertex<ID>>,VertexSet<ID>> computeHighDegreeVertices(PgxGraph graph, int k) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Computes the k vertices with the highest degrees in the graph.
Definition
Computes the k vertices with the highest degrees in the graph. The resulting map will contain a mapping with the sorted index to the high-degree vertex with the index.
Implementation Details
null
Complexity
- Time:
O(N log N) with N = number of vertices
- Space:
O(k) with V = number of vertices
Default Values
Applications
- Can be used to compute the vertices with the highest degrees a.k.a. super-vertices. This information can be useful in certain applications.
- Parameters:
graph
- the graph.k
- number of high-degree vertices to be computed.- Returns:
- Pair holding first a map with the top
k
high-degree vertices and their indices and a second vertex set containing the same vertices. - Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
createDistanceIndex
public <ID> VertexProperty<ID,PgxVect<java.lang.Integer>> createDistanceIndex(PgxGraph graph, PgxMap<java.lang.Integer,PgxVertex<ID>> highDegreeVertexMapping, VertexSet<ID> highDegreeVertices) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Computes an index with distances to each high-degree vertex.
Definition
Computes an index which contains the distance to the given high-degree vertices for every node in the graph.
Implementation Details
null
Complexity
- Time:
O(E * k) with E = number of edges, k <= number of high-degree vertices
- Space:
O(V * k) with V = number of vertices
Default Values
Applications
- The index can be used to speed up certain path-finding algorithms.
- Parameters:
graph
- the graph.highDegreeVertexMapping
- map containing the high-degree vertices as values and indices from 0 to k as keys.highDegreeVertices
- a set containing the high-degree vertices.- Returns:
- A vertex-integer-vector property containing the distances from each high-degree vertex for each vertex in the graph.
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
createDistanceIndex
public <ID> VertexProperty<ID,PgxVect<java.lang.Integer>> createDistanceIndex(PgxGraph graph, PgxMap<java.lang.Integer,PgxVertex<ID>> highDegreeVertexMapping, VertexSet<ID> highDegreeVertices, VertexProperty<ID,PgxVect<java.lang.Integer>> index) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Computes an index with distances to each high-degree vertex.
Definition
Computes an index which contains the distance to the given high-degree vertices for every node in the graph.
Implementation Details
null
Complexity
- Time:
O(E * k) with E = number of edges, k <= number of high-degree vertices
- Space:
O(V * k) with V = number of vertices
Default Values
Applications
- The index can be used to speed up certain path-finding algorithms.
- Parameters:
graph
- the graph.highDegreeVertexMapping
- map containing the high-degree vertices as values and indices from 0 to k as keys.highDegreeVertices
- a set containing the high-degree vertices.index
- (out-argument) the index containing the distances to each high-degree vertex for all vertices.- Returns:
- A vertex-integer-vector property containing the distances from each high-degree vertex for each vertex in the graph.
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
limitedShortestPathHopDist
public <ID> Pair<VertexSequence<ID>,EdgeSequence> limitedShortestPathHopDist(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, int maxHops, PgxMap<java.lang.Integer,PgxVertex<ID>> highDegreeVertexMapping, VertexSet<ID> highDegreeVertices, VertexProperty<ID,PgxVect<java.lang.Integer>> index, VertexSequence<ID> pathVertices, EdgeSequence pathEdges) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Computes the k-hop limited shortest path between two vertices.
Definition
Computes the shortest path between the source and destination vertex. The algorithm only considers paths up to a length of k.
Implementation Details
null
Complexity
- Time:
O(E) with E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Path-finding applications where the path should be / can be limited by a certain number of hops.
- Parameters:
graph
- the graph.src
- the source vertex.dst
- the destination vertex.maxHops
- the maximum number of edges to follow when trying to find a path.highDegreeVertexMapping
- the high-degree vertices.highDegreeVertices
- the high-degree vertices.index
- index containing distances to high-degree vertices.pathVertices
- (out-argument) will contain the vertices on the found path or will be empty if there is none.pathEdges
- (out-argument) will contain the vertices on the found path or will be empty if there is none.- Returns:
- A pair containing the vertices in the shortest path from
src
todst
and the edges on the path. Both will be empty if there is no path withinmaxHops
steps. - Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
limitedShortestPathHopDist
public <ID> Pair<VertexSequence<ID>,EdgeSequence> limitedShortestPathHopDist(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, int maxHops, PgxMap<java.lang.Integer,PgxVertex<ID>> highDegreeVertexMapping, VertexSet<ID> highDegreeVertices, VertexProperty<ID,PgxVect<java.lang.Integer>> index) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Computes the k-hop limited shortest path between two vertices.
Definition
Computes the shortest path between the source and destination vertex. The algorithm only considers paths up to a length of k.
Implementation Details
null
Complexity
- Time:
O(E) with E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Path-finding applications where the path should be / can be limited by a certain number of hops.
- Parameters:
graph
- the graph.src
- the source vertex.dst
- the destination vertex.maxHops
- the maximum number of edges to follow when trying to find a path.highDegreeVertexMapping
- the high-degree vertices.highDegreeVertices
- the high-degree vertices.index
- index containing distances to high-degree vertices.- Returns:
- A pair containing the vertices in the shortest path from
src
todst
and the edges on the path. Both will be empty if there is no path withinmaxHops
steps. - Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
limitedShortestPathHopDistFiltered
public <ID> Pair<VertexSequence<ID>,EdgeSequence> limitedShortestPathHopDistFiltered(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, int maxHops, PgxMap<java.lang.Integer,PgxVertex<ID>> highDegreeVertexMapping, VertexSet<ID> highDegreeVertices, VertexProperty<ID,PgxVect<java.lang.Integer>> index, EdgeFilter filter, VertexSequence<ID> pathVertices, EdgeSequence pathEdges) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Computes the k-hop limited shortest path between two vertices.
Definition
Computes the shortest path between the source and destination vertex. The algorithm only considers paths up to a length of k.
Implementation Details
null
Complexity
- Time:
O(E) with E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Path-finding applications where the path should be / can be limited by a certain number of hops.
- Parameters:
graph
- the graph.src
- the source vertex.dst
- the destination vertex.maxHops
- the maximum number of edges to follow when trying to find a path.highDegreeVertexMapping
- the high-degree vertices.highDegreeVertices
- the high-degree vertices.index
- index containing distances to high-degree vertices.filter
- filter to be evaluated on the edges when searching for a path.pathVertices
- (out-argument) will contain the vertices on the found path or will be empty if there is none.pathEdges
- (out-argument) will contain the vertices on the found path or will be empty if there is none.- Returns:
- A pair containing the vertices in the shortest path from
src
todst
and the edges on the path. Both will be empty if there is no path withinmaxHops
steps. - Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
limitedShortestPathHopDistFiltered
public <ID> Pair<VertexSequence<ID>,EdgeSequence> limitedShortestPathHopDistFiltered(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, int maxHops, PgxMap<java.lang.Integer,PgxVertex<ID>> highDegreeVertexMapping, VertexSet<ID> highDegreeVertices, VertexProperty<ID,PgxVect<java.lang.Integer>> index, EdgeFilter filter) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Computes the k-hop limited shortest path between two vertices.
Definition
Computes the shortest path between the source and destination vertex. The algorithm only considers paths up to a length of k.
Implementation Details
null
Complexity
- Time:
O(E) with E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Path-finding applications where the path should be / can be limited by a certain number of hops.
- Parameters:
graph
- the graph.src
- the source vertex.dst
- the destination vertex.maxHops
- the maximum number of edges to follow when trying to find a path.highDegreeVertexMapping
- the high-degree vertices.highDegreeVertices
- the high-degree vertices.index
- index containing distances to high-degree vertices.filter
- filter to be evaluated on the edges when searching for a path.- Returns:
- A pair containing the vertices in the shortest path from
src
todst
and the edges on the path. Both will be empty if there is no path withinmaxHops
steps. - Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
allReachableVerticesEdges
public <ID> org.apache.commons.lang3.tuple.Triple<VertexSet<ID>,EdgeSet,PgxMap<PgxVertex<ID>,java.lang.Integer>> allReachableVerticesEdges(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, int k) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Finds all the vertices and edges on a path between the src and target of length smaller or equal to k.
Definition
Finds all the vertices and edges on a path between the src and target of length smaller or equal to k.
Implementation Details
null
Complexity
- Time:
O(E) with E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Parameters:
graph
- the graph.src
- the source vertex.dst
- the destination vertex.k
- the dimension of the distances property; i.e. number of high-degree vertices.- Returns:
- a
Triple
containing a vertex-set with the vertices on the path, an edge-set with the edges on the path and a map containing the distances from the source vertex for each vertex on the path - Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
allReachableVerticesEdgesFiltered
public <ID> org.apache.commons.lang3.tuple.Triple<VertexSet<ID>,EdgeSet,PgxMap<PgxVertex<ID>,java.lang.Integer>> allReachableVerticesEdgesFiltered(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, int k, EdgeFilter filter) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Finds all the vertices and edges on a path between the src and target of length smaller or equal to k.
Definition
Finds all the vertices and edges on a path between the src and target of length smaller or equal to k.
Implementation Details
null
Complexity
- Time:
O(E) with E = number of edges
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Parameters:
graph
- the graph.src
- the source vertex.dst
- the destination vertex.k
- the dimension of the distances property; i.e. number of high-degree vertices.filter
- the filter to be used on edges when searching for a path.- Returns:
- a
Triple
containing a vertex-set with the vertices on the path, an edge-set with the edges on the path and a map containing the distances from the source vertex for each vertex on the path - Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
enumerateSimplePaths
public <ID> org.apache.commons.lang3.tuple.Triple<ScalarSequence<java.lang.Integer>,VertexSequence<ID>,EdgeSequence> enumerateSimplePaths(PgxGraph graph, PgxVertex<ID> src, PgxVertex<ID> dst, int k, VertexSet verticesOnPath, EdgeSet edgesOnPath, PgxMap<PgxVertex<ID>,java.lang.Integer> dist) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Enumerate all simple paths between the source and destination vertex
Definition
Enumerate all simple paths between the source and destination vertex
Implementation Details
null
Complexity
- Time:
O(E * k) with E = number of edges, k <= maximum number of iterations
- Space:
O(V) with V = number of vertices
Default Values
Applications
- Parameters:
graph
- the graph.src
- the source vertex.dst
- the destination vertex.k
- the dimension of the distances property; i.e. number of high-degree vertices.verticesOnPath
- the vertices on the path.edgesOnPath
- the edges on the path.dist
- map containing the distance from the source vertex for each vertex on a path.- Returns:
- a
Triple
containing a sequence containing the path lengths, a vertex-sequence containing the vertices on the paths and an edge-sequence containing the edges on the paths - Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- Time:
-
randomWalkWithRestart
public <ID> PgxMap<PgxVertex<ID>,java.lang.Integer> randomWalkWithRestart(PgxGraph graph, ID source, int length, java.math.BigDecimal resetProb, PgxMap<PgxVertex<ID>,java.lang.Integer> visitCount) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundrandomWalkWithRestart(PgxGraph, PgxVertex, int, double, PgxMap)
taking a vertex ID instead of aPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
matrixFactorizationRecommendations
public <ID> VertexProperty<ID,java.lang.Double> matrixFactorizationRecommendations(BipartiteGraph graph, ID user, int vectorLength, VertexProperty<ID,PgxVect<java.lang.Double>> feature, VertexProperty<ID,java.lang.Double> estimatedRating) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundmatrixFactorizationRecommendations(BipartiteGraph, PgxVertex, int, VertexProperty, VertexProperty)
taking a vertex ID instead of aPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
personalizedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedPagerank(PgxGraph graph, ID vertexId, java.math.BigDecimal e, java.math.BigDecimal d, int max) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper around {@link #personalizedPagerank(PgxGraph, PgxVertex, BigDecimal, BigDecimal, int,)} taking a vertex ID instead of aPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
personalizedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedPagerank(PgxGraph graph, ID vertexId, java.math.BigDecimal e, java.math.BigDecimal d, int max, boolean norm) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundpersonalizedPagerank(PgxGraph, PgxVertex, BigDecimal, BigDecimal, int, boolean)
taking a vertex ID instead of aPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
personalizedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedPagerank(PgxGraph graph, ID vertexId, java.math.BigDecimal e, java.math.BigDecimal d, int max, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper around#personalizedPagerank(PgxGraph, PgxVertex, BigDecimal, BigDecimal, int, VertexProperty<ID, Double>)
taking a vertex ID instead of aPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
personalizedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedPagerank(PgxGraph graph, ID vertexId, java.math.BigDecimal e, java.math.BigDecimal d, int max, boolean norm, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper around#personalizedPagerank(PgxGraph, PgxVertex, BigDecimal, BigDecimal, int, boolean, VertexProperty<ID, Double>)
taking a vertex ID instead of aPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
personalizedWeightedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedWeightedPagerank(PgxGraph graph, ID vertexId, java.math.BigDecimal e, java.math.BigDecimal d, int max, EdgeProperty<java.lang.Double> weight) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundpersonalizedWeightedPagerank(PgxGraph, PgxVertex, BigDecimal, BigDecimal, int, EdgeProperty)
taking a vertex ID instead of aPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
personalizedWeightedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedWeightedPagerank(PgxGraph graph, ID vertexId, java.math.BigDecimal e, java.math.BigDecimal d, int max, boolean norm, EdgeProperty<java.lang.Double> weight) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundpersonalizedWeightedPagerank(PgxGraph, PgxVertex, BigDecimal, BigDecimal, int, boolean, EdgeProperty)
taking a vertex ID instead of aPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
personalizedWeightedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedWeightedPagerank(PgxGraph graph, ID vertexId, java.math.BigDecimal e, java.math.BigDecimal d, int max, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper around#personalizedWeightedPagerank(PgxGraph, PgxVertex, BigDecimal, BigDecimal, int, EdgeProperty, VertexProperty<ID, Double>)
taking a vertex ID instead of aPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
personalizedWeightedPagerank
public <ID> VertexProperty<ID,java.lang.Double> personalizedWeightedPagerank(PgxGraph graph, ID vertexId, java.math.BigDecimal e, java.math.BigDecimal d, int max, boolean norm, EdgeProperty<java.lang.Double> weight, VertexProperty<ID,java.lang.Double> rank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper around#personalizedWeightedPagerank(PgxGraph, PgxVertex, BigDecimal, BigDecimal, int, boolean, EdgeProperty, VertexProperty<ID, Double>)
taking a vertex ID instead of aPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
whomToFollow
public <ID> Pair<VertexSequence<ID>,VertexSequence<ID>> whomToFollow(PgxGraph graph, ID vertexId, int topK) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundwhomToFollow(PgxGraph, PgxVertex, int)
taking a vertex ID instead of aPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
whomToFollow
public <ID> Pair<VertexSequence<ID>,VertexSequence<ID>> whomToFollow(PgxGraph graph, ID vertexId, int topK, int sizeCircleOfTrust) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundwhomToFollow(PgxGraph, PgxVertex, int, int)
taking a vertex ID instead of aPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
whomToFollow
public <ID> Pair<VertexSequence<ID>,VertexSequence<ID>> whomToFollow(PgxGraph graph, ID vertexId, int topK, int sizeCircleOfTrust, int maxIter, java.math.BigDecimal tol, java.math.BigDecimal dampingFactor, int salsaMaxIter, java.math.BigDecimal salsaTol) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundwhomToFollow(PgxGraph, PgxVertex, int, int, int, BigDecimal, BigDecimal, int, BigDecimal)
taking a vertex ID instead of aPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
whomToFollow
public <ID> Pair<VertexSequence<ID>,VertexSequence<ID>> whomToFollow(PgxGraph graph, ID vertexId, int topK, int sizeCircleOfTrust, int maxIter, java.math.BigDecimal tol, java.math.BigDecimal dampingFactor, int salsaMaxIter, java.math.BigDecimal salsaTol, VertexSequence<ID> hubs, VertexSequence<ID> authorities) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundwhomToFollow(PgxGraph, PgxVertex, int, int, int, BigDecimal, BigDecimal, int, BigDecimal, VertexSequence, VertexSequence)
taking a vertex ID instead of aPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
fattestPath
public <ID> AllPaths<ID> fattestPath(PgxGraph graph, ID rootId, EdgeProperty<java.lang.Double> capacity) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundfattestPath(PgxGraph, PgxVertex, EdgeProperty)
taking a vertex ID instead of aPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
fattestPath
public <ID> AllPaths<ID> fattestPath(PgxGraph graph, ID rootId, EdgeProperty<java.lang.Double> capacity, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundfattestPath(PgxGraph, PgxVertex, EdgeProperty, VertexProperty, VertexProperty, VertexProperty)
taking a vertex ID instead of aPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
shortestPathDijkstra
public <ID> PgxPath<ID> shortestPathDijkstra(PgxGraph graph, ID srcId, ID dstId, EdgeProperty<java.lang.Double> cost) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundshortestPathDijkstra(PgxGraph, PgxVertex, PgxVertex, EdgeProperty)
taking vertex IDs instead ofPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
shortestPathDijkstra
public <ID> PgxPath<ID> shortestPathDijkstra(PgxGraph graph, ID srcId, ID dstId, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundshortestPathDijkstra(PgxGraph, PgxVertex, PgxVertex, EdgeProperty)
taking vertex IDs instead ofPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
shortestPathFilteredDijkstra
public <ID> PgxPath<ID> shortestPathFilteredDijkstra(PgxGraph graph, ID srcId, ID dstId, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundshortestPathFilteredDijkstra(PgxGraph, PgxVertex, PgxVertex, EdgeProperty, GraphFilter)
taking vertex IDs instead ofPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
shortestPathFilteredDijkstra
public <ID> PgxPath<ID> shortestPathFilteredDijkstra(PgxGraph graph, ID srcId, ID dstId, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundshortestPathFilteredDijkstra(PgxGraph, PgxVertex, PgxVertex, EdgeProperty, GraphFilter)
taking vertex IDs instead ofPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
shortestPathDijkstraBidirectional
public <ID> PgxPath<ID> shortestPathDijkstraBidirectional(PgxGraph graph, ID srcId, ID dstId, EdgeProperty<java.lang.Double> cost) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundshortestPathDijkstraBidirectional(PgxGraph, PgxVertex, PgxVertex, EdgeProperty)
taking vertex IDs instead ofPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
shortestPathDijkstraBidirectional
public <ID> PgxPath<ID> shortestPathDijkstraBidirectional(PgxGraph graph, ID srcId, ID dstId, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundshortestPathDijkstraBidirectional(PgxGraph, PgxVertex, PgxVertex, EdgeProperty)
taking vertex IDs instead ofPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
shortestPathFilteredDijkstraBidirectional
public <ID> PgxPath<ID> shortestPathFilteredDijkstraBidirectional(PgxGraph graph, ID srcId, ID dstId, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundshortestPathFilteredDijkstraBidirectional(PgxGraph, PgxVertex, PgxVertex, EdgeProperty, GraphFilter)
taking vertex IDs instead ofPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
shortestPathFilteredDijkstraBidirectional
public <ID> PgxPath<ID> shortestPathFilteredDijkstraBidirectional(PgxGraph graph, ID srcId, ID dstId, EdgeProperty<java.lang.Double> cost, GraphFilter filterExpr, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundshortestPathFilteredDijkstraBidirectional(PgxGraph, PgxVertex, PgxVertex, EdgeProperty, GraphFilter)
taking vertex IDs instead ofPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
shortestPathBellmanFord
public <ID> AllPaths<ID> shortestPathBellmanFord(PgxGraph graph, ID srcId, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundshortestPathBellmanFord(PgxGraph, PgxVertex, EdgeProperty, VertexProperty, VertexProperty, VertexProperty)
taking a vertex ID instead ofPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
shortestPathBellmanFord
public <ID> AllPaths<ID> shortestPathBellmanFord(PgxGraph graph, ID srcId, EdgeProperty<java.lang.Double> cost) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundshortestPathBellmanFord(PgxGraph, PgxVertex, EdgeProperty)
taking a vertex ID instead ofPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
shortestPathBellmanFordReverse
public <ID> AllPaths<ID> shortestPathBellmanFordReverse(PgxGraph graph, ID srcId, EdgeProperty<java.lang.Double> cost) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundshortestPathBellmanFordReverse(PgxGraph, PgxVertex, EdgeProperty)
taking a vertex ID instead ofPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
shortestPathBellmanFordReverse
public <ID> AllPaths<ID> shortestPathBellmanFordReverse(PgxGraph graph, ID srcId, EdgeProperty<java.lang.Double> cost, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundshortestPathBellmanFordReverse(PgxGraph, PgxVertex, EdgeProperty, VertexProperty, VertexProperty, VertexProperty)
taking a vertex ID instead ofPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
shortestPathHopDist
public <ID> AllPaths<ID> shortestPathHopDist(PgxGraph graph, ID srcId) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundshortestPathHopDist(PgxGraph, PgxVertex)
taking a vertex ID instead ofPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
shortestPathHopDist
public <ID> AllPaths<ID> shortestPathHopDist(PgxGraph graph, ID srcId, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundshortestPathHopDist(PgxGraph, PgxVertex, VertexProperty, VertexProperty, VertexProperty)
taking a vertex ID instead ofPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
shortestPathHopDistReverse
public <ID> AllPaths<ID> shortestPathHopDistReverse(PgxGraph graph, ID srcId) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundshortestPathHopDistReverse(PgxGraph, PgxVertex)
taking a vertex ID instead ofPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
shortestPathHopDistReverse
public <ID> AllPaths<ID> shortestPathHopDistReverse(PgxGraph graph, ID srcId, VertexProperty<ID,java.lang.Double> distance, VertexProperty<ID,PgxVertex<ID>> parent, VertexProperty<ID,PgxEdge> parentEdge) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundshortestPathHopDistReverse(PgxGraph, PgxVertex, VertexProperty, VertexProperty, VertexProperty)
taking a vertex ID instead ofPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
personalizedSalsa
public <ID> VertexProperty<ID,java.lang.Double> personalizedSalsa(BipartiteGraph graph, ID v, java.math.BigDecimal d, int maxIterations, java.math.BigDecimal maxDiff) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundpersonalizedSalsa(BipartiteGraph, PgxVertex, BigDecimal, int, BigDecimal)
taking a vertex ID instead ofPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
personalizedSalsa
public <ID> VertexProperty<ID,java.lang.Double> personalizedSalsa(BipartiteGraph graph, ID v, java.math.BigDecimal d, int maxIterations, java.math.BigDecimal maxDiff, VertexProperty<ID,java.lang.Double> salsaRank) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper around#personalizedSalsa(BipartiteGraph, PgxVertex, BigDecimal, int, BigDecimal, VertexProperty<ID, Double>)
taking a vertex ID instead ofPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
prim
public EdgeProperty<java.lang.Boolean> prim(PgxGraph graph, EdgeProperty<java.lang.Double> weight, java.lang.String mstName) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundprim(PgxGraph, EdgeProperty, String)
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
filteredBfs
public <ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>> filteredBfs(PgxGraph graph, ID root) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundfilteredBfs(PgxGraph, PgxVertex)
taking a vertex ID instead ofPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
filteredBfs
public <ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>> filteredBfs(PgxGraph graph, ID root, int maxDepth) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundfilteredBfs(PgxGraph, PgxVertex, int)
taking a vertex ID instead ofPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
filteredDfs
public <ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>> filteredDfs(PgxGraph graph, ID root) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundfilteredDfs(PgxGraph, PgxVertex)
taking a vertex ID instead ofPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
filteredDfs
public <ID> Pair<VertexProperty<ID,java.lang.Integer>,VertexProperty<ID,PgxVertex<ID>>> filteredDfs(PgxGraph graph, ID root, int maxDepth) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenience wrapper aroundfilteredDfs(PgxGraph, PgxVertex, int)
taking a vertex ID instead ofPgxVertex
.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
-