Skip to content

A short python script to visualize factor graphs passed in as matrix inputs.

License

Notifications You must be signed in to change notification settings

Delmond/Factor-Graph-Visualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Factor Graph Visualizer

A short script written in python3 for factor graph visualization.

Setup

This script relies on the graph-tool utility. Please follow the installing instructions on their wegraphage before using this script.

Usage:

python visualise.py -i /path/to/matrix.txt -o drawn_graph.png

Examples

First example

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:

Second example

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:

About

A short python script to visualize factor graphs passed in as matrix inputs.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages