1
votes

I am attempting to draw an undirected graph in iGraph, but the graph I draw seems to have little arrows on it still. Is it possible to convert the directed graph object to an undirected graph object, so that the arrows are gone?

Here's my code:

import igraph
import cairo
import igraph
graph = igraph.Graph.Read_Ncol('network.txt')
igraph.plot(graph)

network.txt =

1 2
2 1
2 3
2 7
3 1
4 2
4 6
5 4
5 6
7 4
7 8
8 9
9 7
10 7
10 8
10 9
11 2
1 2
3 4
5 8
12 3
1 1
1
Graph.Read_Ncol() has a directed=... keyword argument that lets igraph know whether the graph you are loading is directed or undirected (since the NCOL format does not specify it).Tamás

1 Answers

2
votes

As documented here: http://igraph.org/python/doc/igraph.GraphBase-class.html

There are functions:

to_directed()
to_undirected()

Depending on which way you want to go (it isn't clear to me from the title).