Directed Graph Representation and Traversal in Relational Databases
Graph representation in computers has always been a hot topic due to the number of applications that directly benefit from graphs. Multiple methods have emerged in computer science to represent graphs in numerical/logical formats; most of these methods rely heavily on pointers. However, most current business applications also rely heavily on relational databases as a primary source of storing information. Moreover, most databases are relational by nature, and this does not provide the best-fit scenario to represent graphs. In this work, we present a solution to representing a graph in a relational database. Moreover, we will also provide a set of procedures to traverse this graph and determine the connection path between two given nodes. This work was implemented in an online social/travel website which can be found at http://www.tripbot.com .
Keywordsgraphs relational databases
Unable to display preview. Download preview PDF.
- 1.Tripbot. Tripbot Friends, http://www.tripbot.com
- 2.Mulliuns, C.: The Future of SQL. IDUG Solutions Journal (1998)Google Scholar
- 3.Graph Theory, http://en.wikipedia.org/wiki/Graph_Theory
- 4.Microsoft. MSDN - Microsoft Developer Network, http://www.msdn.com
- 5.Oracle Communities, http://www.oracle.com/us/community/index.htm
- 6.Celko, J.: Joe Celko’s Trees and Hierarchies in SQL for Smarties. Morgam Kaufmann, New York (2004)Google Scholar
- 7.IBM DeveloperWorks, http://www.ibm.com/developerworks/
- 8.MySQL Reference Manual, http://dev.mysql.com/doc/mysql/en/
- 9.Team, N. Neo4J Graph Database, http://neo4j.org/
- 10.Ambler, S.: Agile Database Techniques: Effective Strategies for the Agile Software Developer. John Wiley & Sons, Chichester (2003)Google Scholar