representing graph using database

Posted by prosseek on Stack Overflow See other posts from Stack Overflow or by prosseek
Published on 2010-06-03T18:57:31Z Indexed on 2010/06/03 19:04 UTC
Read the original article Hit count: 227

Filed under:
|

I need to represent graph information with database.

Let's say, a is connected to b, c, and d.

a -- b
|_ c
|_ d

I can have a node table for a, b, c, and d, and I can also have a link table (FROM, TO) -> (a,b), (a,c), (a,d). For other implementation there might be a way to store the link info as (a,b,c,d), but the number of elements in the table is variable.

  • Q1 : Is there a way to represent variable elements in a table?
  • Q2 : Is there any general way to represent the graph structure using database?

© Stack Overflow or respective owner

Related posts about database

Related posts about graph