in reply to Re: constructing a tree from csv file
in thread constructing a tree from csv file

oiskuu if I run your code on this data:-
__DATA__ M7, Q, P, M7, M28, E, M28, M6, E, M6, Q, Pl,
I get this
M7<-M28<-M6<-Q = Pl.E.E M6<-Q = Pl M28<-M6<-Q = Pl.E
Whereas I expect
M7<-Q = P M28<-M6<-Q = Pl.E M6<-Q = Pl
That is I expect only the shortest path from child to parent if it is there.

Replies are listed 'Best First'.
Re^3: constructing a tree from csv file
by oiskuu (Hermit) on Nov 21, 2013 at 14:23 UTC
    It appears your problem has substantially altered. Please post a new question with all specifics.
    Are the relations fixed to those three? Do they have a cost metric? If multiple shortest paths exist?
      Created a seperate node as per request : http://www.perlmonks.org/?node_id=1063871 Please help