in reply to Re: find shortest path for each query from a CSV file
in thread find shortest path for each query from a CSV file

Sorry but theres a problem with the code. For example consider 2nd line of you output. Its giving double probablity in third column (E.E) M6:   M6<-Q, E.E, IV_32 Whereas according to the __DATA__ M6 is coming directly from Q

M6    Q    E

Thus correct output should be :-  M6:   M6<-Q, E, II_15

To give you an intuition this line in data means that the probability of M6 coming from Q is 'E'. That is what I want in third column. If suppose M6 were coming from M76 which in turn comes from Q  M6<-M76<-Q and the input data for these were

__DATA__ M6 M76 E M76 Q E
Then in this case M6: M6<-M76<-Q, E.E, IV_32 would have been a correct output.

So basically the third column is giving wront output, due to which fourth column is also giving incorrect results as it is based on third for its input.

Replies are listed 'Best First'.
Re^3: find shortest path for each query from a CSV file
by GrandFather (Saint) on Nov 25, 2013 at 06:29 UTC

    Sorry, but any problem with the code is now your problem. A trivial examination of the output and thinking about it will tell you why it is as it as. Feel free to correct the code as you see fit.

    True laziness is hard work