{"id":32152139,"url":"https://github.com/juliagraphs/igraphs.jl","last_synced_at":"2026-03-01T04:35:06.945Z","repository":{"id":282978423,"uuid":"949500001","full_name":"JuliaGraphs/IGraphs.jl","owner":"JuliaGraphs","description":null,"archived":false,"fork":false,"pushed_at":"2025-09-25T12:22:51.000Z","size":61,"stargazers_count":8,"open_issues_count":1,"forks_count":2,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-09-30T20:27:28.138Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/JuliaGraphs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2025-03-16T15:48:27.000Z","updated_at":"2025-09-27T03:57:13.000Z","dependencies_parsed_at":"2025-03-18T00:32:48.296Z","dependency_job_id":"f23dc49e-a132-4afa-b2b0-4d3448a4e75d","html_url":"https://github.com/JuliaGraphs/IGraphs.jl","commit_stats":null,"previous_names":["juliagraphs/igraphs.jl"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/JuliaGraphs/IGraphs.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaGraphs%2FIGraphs.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaGraphs%2FIGraphs.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaGraphs%2FIGraphs.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaGraphs%2FIGraphs.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JuliaGraphs","download_url":"https://codeload.github.com/JuliaGraphs/IGraphs.jl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaGraphs%2FIGraphs.jl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280248571,"owners_count":26297925,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-10-21T11:00:31.620Z","updated_at":"2025-10-21T11:01:36.478Z","avatar_url":"https://github.com/JuliaGraphs.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"A thin Julia wrapper around the C graphs library [`igraph`](https://igraph.org/).\n\n### Wrapper types\n\nMost C types (like `igraph_vector_int_t`) are directly available in `IGraphs.LibIGraph` and also have Julian wrappers (like `IGVectorInt`). There is also `IGNull` as a convenient placeholder for whenever the `igraph` C function expects a `NULL` argument.\n\n### High-level Julian interfaces\n\nThe Julian `IGraph` wrapper of the C `igraph_t` follows the `Graphs.jl` interface. Similarly the (`IGVector*` which wrap `igraph_vector_*_t`) and `IGMatrix*` (which wrap `igraph_matrix_*_t`) follow the Julia array interface. Other Julian interfaces are not implemented yet.\n\nBy default, all of these types are initialized, but empty. If you want to create unsafe uninitialized types (i.e. wrappers around uninitialized C structs) use `T(;_uninitialized=Var(true))` -- but be careful, uninitialized structs can cause segfaults on garbage collection.\n\n### Alternatives to Graphs.jl algorithms\n\nSome Graphs.jl functions have new methods defined here, which provide an alternative implementation for the given algorithm. E.g. `Graphs.diameter(graph)` runs a Julia-native implementation of that algorithm from `Graphs.jl`. Here we add the method `diamater(graph, ::IGraphAlg)` which converts `graph` to an `IGraph` type and runs the corresponding algorithm from the `igraph` C library.\n\nDispatch to these new methods happens by adding an instance of the `IGraphAlg` type.\n\nTo see all such methods, use\n```julia-repl\njulia\u003e igraphalg_methods()\n3-element Vector{Symbol}:\n :diameter\n :has_isomorph\n :radius\n```\n\n### Conversions between Julia types from elsewhere in the ecosystem and IGraph Julian wrapper types\n\nA (currently slow) convertor between `Graphs.Graph` and `IGraphs.IGraph` is available (simply by calling the constructors of one type on instances of the other type).\n\n### Raw C bindings\n\nThe raw bindings for `igraph` are provided in `IGraphs.LibIGraph`. E.g. the following C function\n\n```c\nigraph_error_t igraph_get_eid(const igraph_t *graph, igraph_int_t *eid,\n                   igraph_int_t from, igraph_int_t to,\n                   igraph_bool_t directed, igraph_bool_t error);\n```\n\nis available as the following Julia call\n\n```julia\nfunction igraph_get_eid(graph, eid, from, to, directed, error)\n    ccall((:igraph_get_eid, libigraph), igraph_error_t, (Ptr{igraph_t}, Ptr{igraph_int_t}, igraph_int_t, igraph_int_t, igraph_bool_t, igraph_bool_t), graph, eid, from, to, directed, error)\nend\n```\n\n### Low-level Julian bindings\n\nFor each C function `igraph_functionname` there is a higher-level Julian `functionname` (also in `IGraphs.LibIGraph`), but modified as follows:\n\n- errors are raised instead of just returned\n- pointers to primitive types are hidden and the modified values of these primitive types are returned\n- pointers to non-primitive C types are turned into Julian wrapper types\n- the `igraph_` prefix is dropped from the function name\n\nE.g. the C `igraph_get_eid` from above becomes\n\n```julia\nfunction get_eid(graph, from, to, directed, error)\n    eid = fill(igraph_int_t(0), ())\n    res = igraph_get_eid(graph.objref, pointer(eid), igraph_int_t(from), igraph_int_t(to), igraph_bool_t(directed), igraph_bool_t(error))\n    res == 0 || error(\"igraph's C library reports error \", res)\n    return (Int(eid[]),)\nend\n```\n\n### Version number\n\nIGraphs.jl v`X.Y.Z` will always wrap a v`x.y.z` of the C library igraph where `X=x` and `Y=y`. `Z` and `z` might not match.\n\n### Details and Wrapper stats\n\n```julia-repl\n# how many functions exist in the C library that are now accessible through `LibIGraph.igraph_functionname`\njulia\u003e IGraphs.allbindings |\u003e length\n1994\n\n# how many functions are wrapped in a more Julian call interface and accessible through `LibIGraph.functionname`\njulia\u003e IGraphs.translatedbindings |\u003e length\n1203\n\n# the difference between those two numbers\njulia\u003e IGraphs.untranslatedbindings |\u003e length\n791\n\n# the number of C types with Julian wrappers\njulia\u003e IGraphs.wrappedtypes |\u003e length\n17\n\n# the mapping between a C type and the wrapper with a Julian API\njulia\u003e IGraphs.wrappedtypes\nDict{Expr, Symbol} with 18 entries:\n  :(Ptr{igraph_matrix_bool_t})     =\u003e :IGMatrixBool\n  :(Ptr{igraph_matrix_char_t})     =\u003e :IGMatrixChar\n  :(Ptr{igraph_vector_char_t})     =\u003e :IGVectorChar\n  :(Ptr{igraph_vector_int_list_t}) =\u003e :IGVectorIntList\n  :(Ptr{igraph_matrix_list_t})     =\u003e :IGMatrixFloatList\n  :(Ptr{igraph_vector_list_t})     =\u003e :IGVectorFloatList\n  :(Ptr{igraph_vector_complex_t})  =\u003e :IGVectorComplex\n  :(Ptr{igraph_adjlist_t})         =\u003e :IGAdjList\n  :(Ptr{igraph_matrix_complex_t})  =\u003e :IGMatrixComplex\n  :(Ptr{igraph_bitset_list_t})     =\u003e :IGBitSetList\n  :(Ptr{igraph_t})                 =\u003e :IGraph\n  :(Ptr{igraph_bitset_t})          =\u003e :IGBitSet\n  :(Ptr{igraph_matrix_int_t})      =\u003e :IGMatrixInt\n  :(Ptr{igraph_vector_t})          =\u003e :IGVectorFloat\n  :(Ptr{igraph_vector_int_t})      =\u003e :IGVectorInt\n  :(Ptr{igraph_vector_bool_t})     =\u003e :IGVectorBool\n  :(Ptr{igraph_matrix_t})          =\u003e :IGMatrixFloat\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliagraphs%2Figraphs.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuliagraphs%2Figraphs.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliagraphs%2Figraphs.jl/lists"}