Skip to content

ReactiveBayes/BipartiteFactorGraphs.jl

Repository files navigation

BipartiteFactorGraphs.jl

BipartiteFactorGraphs.jl

Stable Dev Build Status Coverage Aqua

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.

Installation

using Pkg
Pkg.add("BipartiteFactorGraphs")

Or in Julia REPL press ] to enter Pkg mode:

] add BipartiteFactorGraphs

Features

  • Flexible representation of bipartite factor graphs
  • Efficient manipulation of graph structure
  • Support for common graph operations
  • Type-stable implementation for performance

Basic Usage

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

Documentation

For more detailed information about the package functionality, please refer to the documentation.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

License

This package is licensed under the MIT License - see the LICENSE.md file for details.