Yea it would depend on whether you are interested solely on resolving the nodes, or if you are more concerned about resolving the relationships. NodeA could have and edge to NodeB, and. NodeB could have a different edge to NodeA. They both relate to each other, and while the Node references are the same, the edges in the graph are unique. As long as you are maintaining an index of nodes and using the same references, you shouldn't end up duplicating data.
You could also check out this library, which can handle letting you just loop over connections and throwing nodes and edges at it, and it will manage the graph https://networkx.github.io It comes with a bunch of graph algorithms to traverse and evaluate stuff. On Fri, 20 Mar 2015 12:02 AM Fredrik Averpil <[email protected]> wrote: > Sweet, thanks Marcus! > > > On Thu, Mar 19, 2015 at 11:23 AM Marcus Ottosson <[email protected]> > wrote: > >> Looks good to me. >> >> Depending on your use-case, you might find that about half of the >> information you store about connections is duplicated due to A being >> connected to B, but B also being connected to A. It’s a fairly common >> problem in graph theory, here’s some interesting reads about possible >> solutions and their pros and cons. >> >> - http://en.wikipedia.org/wiki/Adjacency_list >> - http://en.wikipedia.org/wiki/Adjacency_matrix >> >> Best, >> Marcus >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Python Programming for Autodesk Maya" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOBA%2BmSqSfZsBk_MgOnG67dgjbuw_zsEDPPZc2wrbWw6sA%40mail.gmail.com >> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOBA%2BmSqSfZsBk_MgOnG67dgjbuw_zsEDPPZc2wrbWw6sA%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWNVH4vsf2qz7Nq1%3D4UOdNCoSZcS%3Daq0itL3dp4fC%2B0O4Q%40mail.gmail.com > <https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWNVH4vsf2qz7Nq1%3D4UOdNCoSZcS%3Daq0itL3dp4fC%2B0O4Q%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1rSEuVfp-FM6cYY_nYs82OTjvDOmEF6ESrmuw%3D6Gm3nQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
