Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

consecutive node sequence and pathlength problem using networkx graph

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


bobtnur78 at gmail

Jun 13, 2012, 4:44 PM

Post #1 of 1 (123 views)
Permalink
consecutive node sequence and pathlength problem using networkx graph

Let say,I have a conjugated cyclic polygon and its nodes are given
by the list:
list_p=[a,b,c,d,e,f,g,a,a,b,d,d,d,d,d,c,c,e,e,a,d,d,g]. If X & Y
are any elements in
a list_p except d, and Z is also an element of list_p but has
value only d, i.e,
Z=d. Now,I want to compute the number of paths with sequence X-Z-
Y consecutive nodes,
example: a-d-d-e,a-d-d-a, a-d-d-d-g, etc. Consecutive path length
of Z can be 1,2,3,4 or 5.

To generalize: Find total number of paths with consecutive X-Z-Y
sequence for path length of
z within range(1,6): or
(i) X-Z-Y for len(Z)=1
(ii) X-Z-Y for len(Z)=2
(iii)X-Z-Y for len(Z)=3
(iv) X-Z-Y for len(Z)=4
(v) X-Z-Y for len(Z)=5

Is there any easy way to program this using python networkx or
igraph?

--
http://mail.python.org/mailman/listinfo/python-list

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.