CLI to turn tuples into adjacency matrices
This is a hobby project in early development.
Tested on
cargo 1.42.0-nightly
.txt
tuple input.md
, and .json
file inputstdin
tuple inputGiven a source file containing a directed graph represented as source->target
2-tuples, ttm-rs
creates an adjacency matrix where ij
is 1
when i
has
j
as a target.
For example, digraph.txt
txt
0 3
1 2
2 2
2 3
3 1
Run using newline as tuple delimiter (default)
shell
cargo r -- -f ./digraph.txt
prints to stdout
shell
[[0, 0, 0, 1],
[0, 0, 1, 0],
[0, 0, 1, 1],
[0, 1, 0, 0]]
shell
cargo install ttm-rs