szhorvat / IGraphM

IGraph/M is the igraph interface for Mathematica
http://szhorvat.net/mathematica/IGraphM
Other
90 stars 17 forks source link

IGGraphEditor always adds directed edges when initial graph given #115

Closed szhorvat closed 2 years ago

szhorvat commented 2 years ago

Describe the bug

When IGGraphEditor is given an initial undirected graph, it still adds directed edges.

To Reproduce

Evaluate IGGraphEditor[Graph[{1 <-> 2}]] then add an edge. Even though the input graph was undirected, it adds directed edges.

When fixing this, pay attention to empty (edgeless) graphs. They should be treated as undirected. Note that

In[21]:= Through[{DirectedGraphQ, UndirectedGraphQ}[Graph[{1, 2}, {}]]]

Out[21]= {True, True}