Skip to content

skendall/sockem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Sockem

Introduction

Sockem is a simple, low-overhead, easy-to-use Scala DSL/library that provides mechanisms to create and manipulate network graphs. The library is intended to provide an API to generate vertices, edges, and the graph itself based on a simple language notation, as well as allow for multiple types of graph algorithm calculations (i.e. shortest-path first, traveling salesman problems, path finding, etc).

The library is also intended to be small, compact, and succinct, without the overhead of needless abstraction and confusing references (ala scala-graph).

Quick start

  1. Add these lines to your build.sbt.

resolvers += "kndl" at "http://mvn.kndl.org/maven2"

libraryDependencies ++= Seq(
    "org.kndl" %% "sockem" % "0.4"
)
  1. Example usage below:

 // create a graph
 val g = G("graph")

 // create 3 vertices and add 2 edges between vertex1 and vertex2 and vertex1 and vertex3 with weights 5
 g ++ V("vertex1") ++ V("vertex2") ++ V("vertex3") +| ("vertex1", "vertex2", 5) +| ("vertex1","vertex3",5)

 // visits all vertices in the graph and applies "value" to "key"
 g.visitAll(g) { vertex => vertex.set("key","value") }

 // traverses the shortest path of nodes from start to end
 val (distance,path) = g.traverseShortestPath(V("vertex1"),V("vertex2"))

DSL API

REST API

coming soon

About

Scala API/DSL for network graphs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages