in reply to Re: Perl code for finding shortest path not working on large files
in thread Perl code for finding shortest path not working on large files

Fails as in the output is only 20 lines of incorrect associations and paths. The input at the link is somewhat 2500 lines and has more than 400 unique childs, so atleast 400 paths is what I expect.
  • Comment on Re^2: Perl code for finding shortest path not working on large files

Replies are listed 'Best First'.
Re^3: Perl code for finding shortest path not working on large files
by Anonymous Monk on Jul 25, 2014 at 08:37 UTC

    So, do you think the problem is with reading the data into a datastructure?

    What happens if you add the raw data present in the incorrect associations, and add it to your sample input, does the program produce the wrong associations?

    What if you repeat the sample input" so it adds up to about 2000 lines, does the program produce incorrect associations then?

    There is a bad assumption somewhere in the program, you just have to find it ...

    Maybe you can spot the problem if you dump the vars at various points, dd(\%T) ... knowing what should be in your vars at each point in your program , is how you're going to solve this :) its easier to track with a minimal amount of raw input

    sub dd { use Data::Dumper; print Data::Dumper->new([@_])->Sortkeys(1) ->Indent(1)->Useqq(1)->Dump . "\n"; }