From d8c1296dec18a83ea5d8d9429adba75372a41ecc Mon Sep 17 00:00:00 2001 From: filifa Date: Sat, 10 May 2025 00:07:48 -0400 Subject: [PATCH] add README --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..5790eef --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# gv2adj +gv2adj computes adjacency matrices (either weighted or unweighted) for Graphviz +graphs (both directed and undirected). + +## Usage +To get the adjacency matrix of a graph in `graph.gv`: +``` +gv2adj -f graph.gv +``` + +To get the matrix, but using the values stored in the `len` attribute as edge weights: +``` +gv2adj -f graph.gv --weight-attr len +``` + +Say the nodes in the graph are named `foo`, `bar`, and `baz`. To order the rows and columns of the matrix so they correspond to `bar`, `baz`, `foo`: +``` +gv2adj -f graph.gv --order bar,baz,foo +``` + +## Quirks +* If the `--weight-attr` flag is supplied, but an edge does not have the given + attribute, NaN will be output for that edge. +* If there are multiple edges going from node `a` to node `b`, the matrix entry + will be the sum of the two.