MCPcopy Create free account
hub / github.com/alibaba/GraphScope / to_undirected

Method to_undirected

python/graphscope/framework/graph.py:1146–1157  ·  view source on GitHub ↗

Returns an undirected representation of the digraph. Returns: :class:`Graph`: An undirected graph with the same name and nodes and with edge (u, v, data) if either (u, v, data) or (v, u, data) is in the digraph. If both edges exist in digraph, the

(self)

Source from the content-addressed store, hash-verified

1144 return self._session._wrapper(self._graph_node.to_directed())
1145
1146 def to_undirected(self):
1147 """Returns an undirected representation of the digraph.
1148
1149 Returns:
1150 :class:`Graph`: An undirected graph with the same name and nodes and
1151 with edge (u, v, data) if either (u, v, data) or (v, u, data) is in the digraph.
1152 If both edges exist in digraph, they will both be preserved.
1153 You must check and correct for this manually if desired.
1154 """
1155 if not self._directed:
1156 return self
1157 return self._session._wrapper(self._graph_node.to_undirected())
1158
1159 def is_directed(self):
1160 return self._directed

Callers 2

to_undirectedMethod · 0.45
test_transformFunction · 0.45

Calls 1

_wrapperMethod · 0.80

Tested by 1

test_transformFunction · 0.36