[igraph] going from a directed to an undirected graph
From:
Alisa Coffin
Subject:
[igraph] going from a directed to an undirected graph
Date:
Fri, 7 Mar 2008 14:30:38 -0500
Dear Gabor and other igraph users,
I am trying to convert a directed graph to an undirected graph. I would like for every pair of directed edges, that it be replaced with on undirected edge. The problem is that on some of my vertice pairs I have multiple edges, that actually are real parallel connections which need to be maintained. Think of a street that goes straight from one intersection to another ("the low road"), while another "parallel" street takes a different physical route (no internal vertices) to go between the same two intersections ("the high road"). I'm not interested in the direction of traffic, only the fact that a street exists.
My problem is that when I used the as.undirected function with the "collapse" parameter, I wiped out the secondary connection. Is there any way to replace each pair of directed edges with one undirected edge (i.e. not the "each" parameter) without removing multiple edges? Suggestions?
Any help is greatly appreciated.
Regards, Alisa.
-- Alisa Coffin, PhD. Candidate Department of Geography University of Florida Gainesville, FL 32611