Re: How to store complex graph paths in mysql?
> What is the best way to store the hierarchical (nested) paths for directionless graph in MySQL?
It depends. If the graph will have frequent updates, the edge list model (commonly called misleadingly the "adjacency list" model) is often best for both directed and undirected (eg network, see the simple example in the cited article) graphs. If updates won't be frequent, Celko's nested sets model is _much_ easier to query. A common compromise is to use edge list tables for OLTP and regenerate nested sets tables as often as OLAP demands require.
Two other models, especially if---as seems to be your case---paths are going to be a focus: materialised paths, and closure tables.
But you've confused me again. Do "edge_id node_1_id node_2_id" refer to column names, or are those names just your ad hoc references to three node values? If the former, why do your tables really store nodeIds in differently named columns? That sounds impossible to manage. Why not instead have them all in one table and denote their types in other columns which in turn refer to defining lookups?
So, I may not yet understand your question.
Subject
Written By
Posted
Re: How to store complex graph paths in mysql?
June 24, 2015 03:11PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.