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)
| 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 |