Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

Share this Page URL
Help

12.2 Split Node Nested Sets Models for G... > 12.2.3 Reachable Nodes - Pg. 242

12.2 Split Node Nested Sets Models for Graphs 233 If there is more than one path between two nodes, then each path will be distinguished by its own distinct set of number pairs for the nested set representation. If there is only one path (p) between two nodes but this path is a subpath of more than one distinct path, then the end points of (p) will have number pairs for each of these greater paths. As a canonical form, least numbered pairs are returned for these end points. CREATE VIEW PathEndpoints (begin_node_id, end_node_id, begin_lft, begin_rgt, end_lft, end_rgt) AS SELECT G1.node_id, G2.node_id, G1.lft, G1.rgt, G2.lft, G2.rgt FROM (SELECT node_id, MIN(lft), MIN(rgt) FROM NestedSetsGraph GROUP BY node_id) AS G1 (node_id, lft, rgt)