Skip to content

Clojure graph theory implementation of Closest Centrality

Notifications You must be signed in to change notification settings

macedd/graph-centrality

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

graph-centrality

A Clojure app that implements Graph Closest Centrality and exposes an API to handle the graph edges.

Usage

Install the dependencies

lein install

Run the app or the ring server to interact with the api

Server

Start the ring server

lein ring server-headless

Compute Current Centrality

curl -i http://localhost:3000/centrality

Post new Edge (will save to resources/edges)

curl -XPOST --header 'Content-Type: text/plain' \
    -d "63 101" \
    -i http://localhost:3000/add-edge

Repl

Start the repl

lein repl

Run the centrality computation

(-main)

Interact with the graph and its contents (edges are in resources/edges)

(let [g (graph-load filepath)]
    (println g)
    (println (graph-closeness g))
    (graph-centrality g))

License

GPLv2

About

Clojure graph theory implementation of Closest Centrality

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published