cugraph.batched_ego_graphs#
- cugraph.batched_ego_graphs(G, seeds, radius=1, center=True, undirected=None, distance=None)[source]#
This function is deprecated.
Deprecated since 24.04. Batched support for multiple seeds will be added to ego_graph.
Compute the induced subgraph of neighbors for each node in seeds within a given radius.
- Parameters:
- Gcugraph.Graph, networkx.Graph, CuPy or SciPy sparse matrix
Graph or matrix object, which should contain the connectivity information. Edge weights, if present, should be single or double precision floating point values.
- seedscudf.Series or list or cudf.DataFrame
Specifies the seeds of the induced egonet subgraphs.
- radius: integer, optional (default=1)
Include all neighbors of distance<=radius from n.
- center: bool, optional
Defaults to True. False is not supported
- undirected: bool, optional
Defaults to False. True is not supported
- distance: key, optional (default=None)
Distances are counted in hops from n. Other cases are not supported.
- Returns:
- ego_edge_listscudf.DataFrame or pandas.DataFrame
GPU data frame containing all induced sources identifiers, destination identifiers, edge weights
- seeds_offsets: cudf.Series
Series containing the starting offset in the returned edge list for each seed.
Examples
>>> from cugraph.datasets import karate >>> G = karate.get_graph(download=True) >>> cugraph.batched_ego_graphs(G, seeds=[1,5], radius=2)