cugraph.Graph.to_directed#

Graph.to_directed()[source]#

Return a directed representation of the graph. This function sets the directed attribute as True and returns the directed view.

Returns:
GGraph

A directed graph with the same nodes, and each edge (u,v,weights) replaced by two directed edges (u,v,weights) and (v,u,weights).

Examples

>>> M = cudf.read_csv(datasets_path / 'karate.csv', delimiter=' ',
...                   dtype=['int32', 'int32', 'float32'], header=None)
>>> G = cugraph.Graph()
>>> G.from_cudf_edgelist(M, '0', '1')
>>> DiG = G.to_directed()