SaTool-python is an open-source implementation of the tool, for doing structural analysis. The implementation is inspired on the SATOOL developed by Blanke et. all. ”SATOOL - A Software Tool for structural analysis of complex automation systems ”[1] , introduces a tool for structural analysis, the use of the Matlab - based 3 implementation is presented and special features are intro- duced, which were motivated by industrial users.
The code requires networkx development version ( for implementation of bipartite maximal algorithm). Networkx development can be installed by follwoing command
pip install git://github.com/networkx/networkx.git#egg=networkx
- Clone the networkx repostitory git clone https://github.com/networkx/networkx.git (see https://github.com/networkx/networkx/ for other options)
- Change directory to networkx
- Run python setup.py install to build and install
Please refer [Networkx Development installation]{http://networkx.github.io/documentation/development/install.html}
B = nx.Graph(name="Example 5.17")
B.add_nodes_from(['x1', 'x2', 'x3', 'x4', 'x5'], bipartite=0, color='r') # Add the node attribute "bipartite"
B.add_nodes_from(['c1','c2','c3', 'c4', 'c5', 'c6'], bipartite=1, color='b')
B.add_edges_from([('x1','c1'),('x1','c2'),('x1','c4') ])
B.add_edges_from([('x2','c2'),('x2','c5')])
B.add_edges_from([('x3','c2'),('x3','c3')])
B.add_edges_from([('x4','c3'),('x4','c4'),('x4','c6') ])
B.add_edges_from([('x5','c5'),('x5','c6')])
sa1 = sa_tool.SATool(B)
sa1.visualize_bipartite()
![bipartite](images/Example 5.17.png)
sa1.calculate_maximum_matching()
sa1.visualize_bipartite(with_matching=True)
![bipartite](images/Example 5.17MaxMatching.png)
sa1.calculate_orientation()
sa1.visualize_bipartite(with_orientation=True)
![bipartite](images/Example 5.17WithOrientation.png) [1] Denmark, K. (2006). Satool-a software tool for structural analysis of complex auomation systems.
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.199.6246&rep=rep1&type=pdf
structure graph: color --> meaning green --> unknown variables yellow --> constraints Navy blue --> known variables Red --> Unmatched constraint
Structure graph with maximal matching color --> meaning black --> Normal edge Sky Blue --> Matched edge
Structure graph with maximal matching and orientation color --> meaning Multiple Thick Black lines --> Parity relation