Information about optimal path

Issue #399 resolved
Former user created an issue

I have calculated 200 subpotimal paths for a "source" and "sink" combination. Also i got the path length distribution and Node degeneracy table and i am assuming that the shortest path from the path length distribution is the OPTIMAL PATH (please correct me if i am wrong))for the "source-sink" pair. Now i want to know some more information about this particular optimal path(like the resids or nodes through which it travels between the source and sink , and also the other options to explore more)

thanking you

Comments (3)

  1. Xinqiu Yao

    Hi,

    All the information you asked is stored in the returned value of cnapath(). For example,

    pa <- cnapath(net, from = 314, to=172, k=50)
    
    # path length sorted from shortest to longest
    pa$dist
     [1] 4.769075 4.779683 4.790239 4.793736 4.813681 4.834845 4.838342 4.855335
    ...
    
    # Node IDs that the first (shortest) path traverses
    pa$path[[1]]
     [1] 314 164 165 167 168 169 170 172
    

    Hope this can help.

  2. Log in to comment