A short script written in python3 for factor graph visualization.
This script relies on the graph-tool utility. Please follow the installing instructions on their wegraphage before using this script.
python visualise.py -i /path/to/matrix.txt -o drawn_graph.png
Given the following matrix:
14 12
1 0 0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 1 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0 0 0
1 1 0 0 0 1 0 1 0 0 0 0
0 0 0 1 0 0 0 0 1 0 0 0
0 0 0 0 1 0 1 0 0 1 0 0
0 0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 1 1 0 1 0
0 0 0 0 0 0 0 0 0 1 0 1
0 0 0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 0 0 1 1
0 0 0 0 0 1 0 0 0 0 0 0
The generated factor graph is:
Given the following matrix:
1 0 0 0 0 0 1 0 0
0 1 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0
0 0 0 0 0 1 0 1 0
0 0 0 0 0 0 1 0 0
1 1 1 1 0 0 0 0 0
0 1 1 0 0 0 0 0 0
0 1 0 1 1 0 0 0 0
0 0 0 1 1 0 0 0 0
0 0 0 0 0 1 1 0 0
0 0 0 0 1 0 0 0 1
0 0 0 0 1 0 0 0 0
0 0 0 0 1 0 0 0 0
0 0 1 0 0 0 0 1 0
1 0 0 1 0 0 0 0 0
0 1 0 1 0 0 0 0 0
0 1 0 0 0 0 0 0 0
The generated factor graph is: