{"id":32157082,"url":"https://github.com/stecrotti/indexedfactorgraphs.jl","last_synced_at":"2026-02-19T07:01:57.771Z","repository":{"id":232952333,"uuid":"783634281","full_name":"stecrotti/IndexedFactorGraphs.jl","owner":"stecrotti","description":"Factor graphs based on IndexedGraphs.jl","archived":false,"fork":false,"pushed_at":"2025-11-24T21:08:19.000Z","size":844,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-28T02:55:28.335Z","etag":null,"topics":["factor-graphs","factorized-distribution-algorithms","graphs","message-passing"],"latest_commit_sha":null,"homepage":"","language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stecrotti.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-04-08T09:19:20.000Z","updated_at":"2025-11-24T21:03:29.000Z","dependencies_parsed_at":"2025-11-27T16:16:56.274Z","dependency_job_id":null,"html_url":"https://github.com/stecrotti/IndexedFactorGraphs.jl","commit_stats":null,"previous_names":["stecrotti/factorgraphs.jl","stecrotti/indexedfactorgraphs.jl"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/stecrotti/IndexedFactorGraphs.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stecrotti%2FIndexedFactorGraphs.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stecrotti%2FIndexedFactorGraphs.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stecrotti%2FIndexedFactorGraphs.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stecrotti%2FIndexedFactorGraphs.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stecrotti","download_url":"https://codeload.github.com/stecrotti/IndexedFactorGraphs.jl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stecrotti%2FIndexedFactorGraphs.jl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29605799,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T06:47:36.664Z","status":"ssl_error","status_checked_at":"2026-02-19T06:45:47.551Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["factor-graphs","factorized-distribution-algorithms","graphs","message-passing"],"created_at":"2025-10-21T12:42:38.357Z","updated_at":"2026-02-19T07:01:57.766Z","avatar_url":"https://github.com/stecrotti.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IndexedFactorGraphs\n\n[![](https://img.shields.io/badge/docs-dev-blue.svg)](https://stecrotti.github.io/IndexedFactorGraphs.jl/dev)\n[![Build Status](https://github.com/stecrotti/IndexedFactorGraphs.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/stecrotti/IndexedFactorGraphs.jl/actions/workflows/CI.yml?query=branch%3Amain)\n[![codecov](https://codecov.io/gh/stecrotti/IndexedFactorGraphs.jl/graph/badge.svg?token=nGaGg7oJom)](https://codecov.io/gh/stecrotti/IndexedFactorGraphs.jl)\n\nA Julia package to work with [factor graphs](https://en.wikipedia.org/wiki/Factor_graph), based on [IndexedGraphs.jl](https://github.com/stecrotti/IndexedGraphs.jl).\n\n## Installation\n```julia\njulia\u003e using Pkg; Pkg.add(\"IndexedFactorGraphs\")\n```\n\n## Basics\nA factor graph is a set of variable and factor vertices connected by edges. \nIn the spirit of [IndexedGraphs.jl](https://github.com/stecrotti/IndexedGraphs.jl), here each edge comes with an index, which can be used to access edge properties (e.g. messages in a message-passing algorithm).\n\n### Graph construction\nA `FactorGraph` can be constructed starting from an adjacency matrix, with the convention that rows represent factor vertices and columns represent variable vertices\n```julia\njulia\u003e using IndexedFactorGraphs\n\njulia\u003e g = FactorGraph([0 1 1 0;\n                        1 0 0 0;\n                        0 0 1 1])\nFactorGraph{Int64} with 4 variables, 3 factors, and 5 edges\n```\n\nAlternatively, use one of the provided generators for random factor graphs\n```julia\njulia\u003e g_rand = rand_factor_graph(5, 3, 6)\nFactorGraph{Int64} with 5 variables, 3 factors, and 6 edges\n```\n\n### Graph navigation \nGiven a factor graph with $N$ variables and $M$ factors, variables are indexed by $i\\in\\{1,\\ldots,N\\}$, factors are indexed by $a\\in\\{1,\\ldots,M\\}$.\nProperties of a vertex can be queried by wrapping the vertex index in a `v_vertex` or `f_vertex`. For example, the list of neighbors of variable $i=2$ is found by\n```julia\njulia\u003e ∂i = neighbors(g, variable(2));\n\njulia\u003e collect(∂i)\n2-element Vector{Int64}:\n 1\n 3\n```\nwhere $1,3$ are to be interpreted as indices of factor vertices.\n\nThe list of edges adjacent to factor $a=1$ is found by\n```julia\njulia\u003e ea = inedges(g, factor(1));\n\njulia\u003e collect(ea)\n3-element Vector{IndexedGraphs.IndexedEdge{Int64}}:\n Indexed Edge 1 =\u003e 1 with index 1\n Indexed Edge 2 =\u003e 1 with index 2\n Indexed Edge 5 =\u003e 1 with index 6\n```\n\nQuerying properties of a vertex without specifying whether it's a variable or a factor will throw an error\n```julia\njulia\u003e outedges(g, 3)\nERROR: ArgumentError: Properties of a vertex of an `AbstractFactorGraph` such as degree, neighbors, etc. cannot be accessed by an integer. Use a `v_vertex` or `f_vertex` wrapper instead.\n```\n\n## See also\nFor less lightweight implementations, also including message-passing algorithms, check out\n* [FactorGraph.jl](https://github.com/mcosovic/FactorGraph.jl)\n* [ForneyLab.jl](https://github.com/biaslab/ForneyLab.jl)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstecrotti%2Findexedfactorgraphs.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstecrotti%2Findexedfactorgraphs.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstecrotti%2Findexedfactorgraphs.jl/lists"}