Clojure network/graph library wrapping JUNG.
Caveat: This library is now in developing. Not all functions are implemented yet.
Jungerer is available as a Maven artifact from Clojars.
With Leiningen/Boot:
[jungerer "0.1.2"]
- jungerer.graph - creates and manipulates graph
- jungerer.algo - calculates scores such as PageRank
- jungerer.vis - visualizes graph on Swing
- jungerer.io - load/saves external graph formats
jungerer.graph:
(require '[jungerer.graph :as g])
(def graph (g/directed-graph [[1 2] [2 3] [4 2]]))
(g/add-edge! graph [4 5])
(g/nodes graph)
=> #{1 4 3 2 5}
(g/edges graph)
=> ([1 2] [2 3] [4 5] [4 2])
jungerer.algo:
(require '[jungerer.algo :as a])
(def scorer (a/page-rank graph))
(a/score scorer 2)
=> 0.26350079629361517
jungerer.vis:
(require '[jungerer.vis :as v])
(v/view graph)
(v/view (v/kk-layout graph) {:title "My Graph", :frame-size [640 480]})
jungerer.io:
(require '[jungerer.io :as i])
(def graph (g/directed-graph))
(i/load-pairs! "dev-resources/sample.pairs" graph)
(g/add-edge! graph ["AAA" "LLL"])
(i/save-as-pairs "/tmp/sample-edited.pairs" graph)
Copyright © 2016 Toshiki Takeuchi
Distributed under the BSD 3-Clause License.