How kojix2/ruby-igraph works
ruby-igraph provides a Ruby interface to the native igraph network-analysis library. The documented workflow is to create or populate a graph, invoke graph operations through FFI, and read results such as vertex and edge counts. Its binding modules expose graph construction, analysis, layouts, and data structures. The README’s example uses the low-level binding directly; the supplied excerpts do not show how the high-level Graph wrapper delegates to it, so that relationship is not asserted.
Main entry points: libigraph.rb FFI loader · vector.rb Native vectors · paths.rb Paths and structure · community.rb Community analysis
Components 20
Ruby API
- Ruby entry point
lib/igraph.rb - Graph wrapper
lib/igraph/graph.rb - Graph selectors
lib/igraph/vertex_selector.rb - Edge selectors
lib/igraph/edge_selector.rb - Graph I/O
lib/igraph/io.rb
FFI bindings
- FFI loader
lib/igraph/libigraph.rb - Graph construction
lib/igraph/libigraph/constructors.rb - Graph operations
lib/igraph/libigraph/interface.rb
Network analysis
- Paths and structure
lib/igraph/libigraph/paths.rb - Centrality measures
lib/igraph/libigraph/centrality.rb - Community analysis
lib/igraph/libigraph/community.rb - Graph generators
lib/igraph/libigraph/games.rb - Graph layouts
lib/igraph/libigraph/layout.rb - Structural analysis
lib/igraph/libigraph/structural.rb - Adjacency lists
lib/igraph/libigraph/adjlist.rb
Graph data
- Native graph type
lib/igraph/libigraph/datatype.rb - Native vectors
lib/igraph/libigraph/vector.rb - Native matrices
lib/igraph/libigraph/matrix.rb
Native dependency
- igraph C library
Other components
- Ruby caller
Connections 23
- Ruby caller → Ruby entry point: requires
lib/igraph.rb - Ruby caller → FFI loader: calls bindings
- FFI loader → igraph C library: loads library
lib/igraph/libigraph.rb - FFI loader → Graph construction: loads
lib/igraph/libigraph.rb - FFI loader → Graph operations: loads
lib/igraph/libigraph.rb - FFI loader → Paths and structure: loads
lib/igraph/libigraph.rb - FFI loader → Centrality measures: loads
lib/igraph/libigraph.rb - FFI loader → Community analysis: loads
lib/igraph/libigraph.rb - FFI loader → Graph generators: loads
lib/igraph/libigraph.rb - FFI loader → Graph layouts: loads
lib/igraph/libigraph.rb - FFI loader → Structural analysis: loads
lib/igraph/libigraph.rb - FFI loader → Adjacency lists: loads
lib/igraph/libigraph.rb - Graph construction → Native graph type: uses type
lib/igraph/libigraph/constructors.rb - Paths and structure → Native vectors: uses type
lib/igraph/libigraph/paths.rb - Paths and structure → Native matrices: uses type
lib/igraph/libigraph/paths.rb - Centrality measures → Native vectors: uses type
lib/igraph/libigraph/centrality.rb - Community analysis → Native vectors: uses type
lib/igraph/libigraph/community.rb - Community analysis → Native matrices: uses type
lib/igraph/libigraph/community.rb - Graph generators → Native vectors: uses type
lib/igraph/libigraph/games.rb - Structural analysis → Native vectors: uses type
lib/igraph/libigraph/structural.rb - Adjacency lists → Native vectors: uses type
lib/igraph/libigraph/adjlist.rb - Native graph type → Native vectors: embeds
lib/igraph/libigraph/datatype.rb - Native matrices → Native vectors: embeds
lib/igraph/libigraph/matrix.rb