[Numpy-discussion] consecutive node sequence and pathlength of graph

bob tnur bobtnur78 at gmail.com
Wed Jun 13 21:55:42 EDT 2012

    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? , can numpy group have some module to simplify this problem?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20120613/ad11a380/attachment.html>

More information about the NumPy-Discussion mailing list