Welcome to scalax.collection.Graph

Graph for Scala provides basic graph functionality with the look and feel of Scala Library collections. Graph editing, traversing and much more is available at your fingerprint in a Scala-ish way.

Like the members of scala.collection, graph instances are in-memory containers that expose a rich, user-friendly interface.

Just for the records, the first version of Graph for Scala was published in 2011. Backed by the Scala core team, it started in the EPFL Scala incubator space that time.

Why use Graph for Scala?

Some important facts about how Graph for Scala helps to speed up your development are:

  • Simplicity: Creating, manipulating and traversing graphs is intuitive, the graph interface is unified for all graph types.
  • Consistency: Graph for Scala seamlessly maintains a consistent state of nodes and edges including duplicate element prevention, intelligent addition and removal.
  • Conformity: Graph for Scala has the same look and feel as collections in the Scala Library. With result types being Scala collections themselves, you stay in the Scala universe.
  • Flexibility:
    • Label your nodes and edges without any restriction in a type safe way.
    • Choose the best fit for your use case from a wide range of graph types also including mixed graphs, multi-graphs and hypergraphs.
    • Find contained components.
    • Walk from node to node.
    • Supply your node or edge visitor to any traversal optionally.
  • Functional Style: Graph for Scala facilitates a concise, functional style.
  • Documentation: Ideal progress curve through adequate user guides and detailed Scaladoc.

Look and see!

Modules

The Graph for Scala library consists of the Core module and further optional modules with a separate User Guide each, namely:

  • Dot allows for export in DOT format
  • JSON supports JSON serialization/deserialization.

Next steps

Graph for Scala is hosted on Github since 2014. The library is licensed under the Apache 2.0 License.

Want to take it for a spin? Grab the latest release to get started, then visit the Core User Guide to learn more.

Please post your questions on the user list where you can also browse previous questions.

For error reports and enhancement requests use Github Issues.

To improve this site, check out scala-graph-site.

You are also welcome as a contributor.