Skip to content

Clojure network/graph library wrapping JUNG

License

Notifications You must be signed in to change notification settings

totakke/jungerer

Repository files navigation

Jungerer

Clojars Project Build Status

Clojure network/graph library wrapping JUNG.

Installation

Jungerer is available as a Maven artifact from Clojars.

With Leiningen/Boot:

[jungerer "0.4.1"]

Usage

Namespaces

Documentation

API Reference

Example

See example project to quickly try Jungerer.

Basics

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

(a/dijkstra-path graph 4 3)
;;=> [4 2 3]

jungerer.vis:

(require '[jungerer.vis :as v])

;; To visualize simply,
(v/view graph)

;; To specify layout and other options,
(v/view (v/kk-layout graph) {:title "My Graph"
                             :frame-size [640 480]
                             :node-label-fn (fn [node]
                                              (str "node" node))
                             :edge-label-fn (fn [[node1 node2]]
                                              (str node1 " -> " node2))})

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)

License

Copyright © 2016-2019 Toshiki Takeuchi

Distributed under the BSD 3-Clause License.

About

Clojure network/graph library wrapping JUNG

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published