Representing a DAG (directed acyclic graph)

后端 未结 4 1895
醉梦人生
醉梦人生 2021-02-04 09:02

I need to store dependencies in a DAG. (We\'re mapping a new school curriculum at a very fine grained level)

We\'re using rails 3

Considerations

  • W
相关标签:
4条回答
  • 2021-02-04 09:16

    You might want to take a look at the act_as_dag gem.

    https://github.com/resgraph/acts-as-dag

    Also some good writing on Dags with SQL for people that might need some background on this.

    http://www.codeproject.com/Articles/22824/A-Model-to-Represent-Directed-Acyclic-Graphs-DAG-o

    0 讨论(0)
  • 2021-02-04 09:25

    I think the upcoming version (beta at the moment) of the Ruby bindings for the graph database Neo4j should be a good fit. It's for use with Rails 3. The underlying data model uses nodes and directed relationships/edges with key/value style attributes on both. To scale read-mostly architectures Neo4j uses a master/slave replication setup.

    0 讨论(0)
  • 2021-02-04 09:29

    I found this example of modeling a directed acyclic graph in SQL:

    http://www.codeproject.com/KB/database/Modeling_DAGs_on_SQL_DBs.aspx?msg=3051183

    0 讨论(0)
  • 2021-02-04 09:39

    You could use OrientDB as graph database. It's highly optimized for relationships since are stored as link and not JOIN. Load of bidirectional graph with 1,000 vertices needs few milliseconds.

    The language binding for Rails is not yet available, but you can use it with HTTP RESTful calls.

    0 讨论(0)
提交回复
热议问题