27.5.7 Creating a Sparsified Subgraph
The graph server (PGX) supports creating a sparsified subgraph of a graph:
PgxGraph sparsify(double e)
PgxGraph sparsify(double e, String newGraphName)
PgxGraph sparsify(Collection<VertexProperty<?, ?>> vertexProps, Collection<EdgeProperty<?>> edgeProps, double e, String newGraphName)
sparsify(self, sparsification, vertex_properties=True, edge_properties=True, name=None)
The double
argument e
is the
sparsification coefficient with a value between 0.0
and
1.0
.
The user again has the option to specify the name for the newly created
graph (newGraphName
) as well as the vertex and edge properties to
be copied into the newly created graph instance (vertexProps
and
edgeProps
).
The returned PgxGraph
object represents a sparsified
subgraph which has fewer edges than the original graph.
Parent topic: Graph Mutation and Subgraphs