On Sat, Jan 09, 2010 at 03:41:24PM -0500, Robert Citek scratched on the wall: > Hello all, > > Does anyone have any recommendations for books or other resources that > deal with working with graphs (i.e. vertexes and edges) using sql? > > For example, if I could store a graph in a sqlite database, I'd like > to query the database to know if the graph contains a Eulerian > path[1]. > > [1] http://en.wikipedia.org/wiki/Eulerian_path
Joe Celko's "Trees and Hierarchies in SQL for Smarties" has a bit of information, but the primary focus is trees and DAGs. His more general "SQL For Smarties, Advanced SQL Programming" has a number of pages on the topic as well. That book is extremely useful for any number of other topics as well. Of course, these and other books are mostly going to focus on representation. Trees and graphs are data structures that don't map very well into the relational theory of data organization, and while representations can be adopted with some success, algorithms are much more difficult. Even if you find a satisfactory way to store your data structures, it is likely that you'll need to write some fairly extensive query sequences to implement many graph algorithms. It is unlikely you'll be able to reduce even relatively simple graph algorithms to some single massive SQL query. On the other hand, given SQL's strength of manipulating and searching vast sets of data, it may also be possible to re-implement many types of graph algorithms as set manipulations on the representation data. That assumes a pretty in-depth understanding of both graph theory and relational theory, however. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Our opponent is an alien starship packed with atomic bombs. We have a protractor." "I'll go home and see if I can scrounge up a ruler and a piece of string." --from Anathem by Neal Stephenson _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users