A Julia package for working with bipartite factor graphs, providing efficient data structures and algorithms for graph-based probabilistic inference. The package is built on top of and is fully compatible with the Graphs.jl package.
using Pkg
Pkg.add("BipartiteFactorGraphs")
Or in Julia REPL press ]
to enter Pkg mode:
] add BipartiteFactorGraphs
- Flexible representation of bipartite factor graphs
- Efficient manipulation of graph structure
- Support for common graph operations
- Type-stable implementation for performance
using BipartiteFactorGraphs
# Create a new factor graph
g = BipartiteFactorGraph()
# Add variable and factor nodes
v1 = add_variable!(g)
v2 = add_variable!(g)
f1 = add_factor!(g, [v1, v2])
# Check connectivity
@assert is_connected(v1, f1)
@assert is_connected(v2, f1)
# Access node neighbors
neighbors_of_v1 = neighbors(g, v1)
neighbors_of_f1 = neighbors(g, f1)
# Get graph properties
@assert num_variables(g) == 2
@assert num_factors(g) == 1
For more detailed information about the package functionality, please refer to the documentation.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
This package is licensed under the MIT License - see the LICENSE.md file for details.