Legends: P(= Probable) > Pl(=Plausible) > E(=Equivocal). What I want is for each child I want to trace it back to Q(Query), but I need the shortest path which leads it to the Q(Query) along with their probabilities. For example for the input data shown above the output should be :-__DATA__ child, Parent, probability, M7, Q, P, M7, M28, E, M28, M6, E, M6, Q, Pl, & several hundred lines.....
But as we can see from second row of input data M7 has another longer path tracing to Q : M7<-M28<-M6<-Q = Pl.E.E. But the code should have an option to neglect the largest path and thus show only the shortest path OR to show all of them. i.e.__OUTPUT_1__ M7: M7<-Q = P M28: M28<-M6<-Q = Pl.E M6: M6<-Q = Pl
Thus this second output prints a path tracing back to Q for each of the rows, so if we have N input rows to the program , we will have N corresponding output rows.__OUTPUT_2__ M7: M7<-Q = P M7: M7<-M28<-M6<-Q = Pl.E.E M28: M28<-M6<-Q = Pl.E M6: M6<-Q = Pl
In reply to find shortest path for each query from a CSV file by zing
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |