But I still do have the information that "/p" is a link to "/a/b/c/d" in my suggested graph. You have a node "/" which points to node "/p" which points to "/a/b/c/d". There is also another chain - node "/" points to "/a" which points to "/a/b" which points to "/a/b/c" which points to "/a/b/c/d".
it almost seems to me that you want to have a list of links ordered from longest substitution to shortest
Not sure why you think that but it might be because I didn't explain the question well enough. Given such graph, I want to replace any "logical path" with "virtual path". In other words, given some link with it's target, just go over the structure and replace the target with the link.
Now, it might (probaby) be that my structure is not good enough for this task. @etj suggested to use inodes without getting into the real implementation of the inodes (since it's an overkill). But the current structure seems to be similar to what he was talking about. So if the better solution here is to rethink the structure - then how should it look like? How the nodes should be structured?

In reply to Re^4: How to enable virtual paths inside a graph DS? by ovedpo15
in thread How to enable virtual paths inside a graph DS? by ovedpo15

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.