cugraph.Graph.to_undirected#
- Graph.to_undirected()[source]#
Return an undirected copy of the graph.
- Returns:
- GGraph
A undirected graph with the same nodes, and each directed edge (u,v,weights) replaced by an undirected edge (u,v,weights).
Examples
>>> M = cudf.read_csv(datasets_path / 'karate.csv', delimiter=' ', ... dtype=['int32', 'int32', 'float32'], header=None) >>> DiG = cugraph.Graph(directed=True) >>> DiG.from_cudf_edgelist(M, '0', '1') >>> G = DiG.to_undirected()