igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[igraph] grid graphs


From: Raphael C
Subject: [igraph] grid graphs
Date: Mon, 11 Nov 2013 21:28:36 +0000

Hi,

I have  a graph laid out on a 2d graph. Some edges are included in the
graph and some not. The edges are represented as lists of
((x1,y1),(x2,y2)) as in the following example of a complete graph
description,

    edges = [((1, 1), (2, 1)), ((2, 1), (3, 1)), ((3, 1), (4, 1)),
((3, 2), (4, 2)), ((3, 5), (4, 5)), ((4, 1), (5, 1)), ((4, 2), (5,
2)), ((4, 5), (5, 5)), ((1, 1), (1, 2)), ((3, 1), (3, 2)), ((4, 1),
(4, 2)), ((5, 1), (5, 2)), ((5, 2), (5, 3)), ((5, 3), (5, 4)), ((5,
4), (5, 5))]

What is a simple way to make an undirected igraph graph from this
list?  I need to be able to have the nodes labelled by their `(x,y)`
positions.

I would like to be able to plot this graph on a grid too so ideally it
would maintain the positions of the nodes.

I am working in python.

Thanks for any help.
Raphael



reply via email to

[Prev in Thread] Current Thread [Next in Thread]