1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//! trueno-graph: GPU-first embedded graph database
//!
//! # Overview
//!
//! trueno-graph provides GPU-accelerated graph storage and algorithms for code analysis.
//! Built on PAIML's proven infrastructure (trueno, trueno-db, aprender).
//!
//! # Quick Start
//!
//! ```no_run
//! use trueno_graph::{CsrGraph, NodeId};
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! // Build graph from edge list
//! let mut graph = CsrGraph::new();
//! graph.add_edge(NodeId(0), NodeId(1), 1.0)?; // main → parse_args
//! graph.add_edge(NodeId(0), NodeId(2), 1.0)?; // main → validate
//!
//! // Query neighbors (O(1) via CSR indexing)
//! let callees = graph.outgoing_neighbors(NodeId(0))?;
//! assert_eq!(callees.len(), 2);
//!
//! // Save to Parquet (requires "storage" feature, enabled by default)
//! #[cfg(feature = "storage")]
//! graph.write_parquet("graph.parquet").await?;
//!
//! // Load from disk
//! #[cfg(feature = "storage")]
//! let loaded = CsrGraph::read_parquet("graph.parquet").await?;
//! # Ok(())
//! # }
//! ```
//!
//! # Architecture
//!
//! - **Storage**: CSR (Compressed Sparse Row) format for graphs
//! - **Persistence**: Parquet-backed (via trueno-db patterns)
//! - **Algorithms**: Delegates to aprender (`PageRank`, Louvain, centrality)
//! - **Performance**: 25-250x speedups vs CPU baselines (GPU mode)
// GPU acceleration (Phase 3 - optional)
// Re-export core types
pub use ;
pub use ;
pub use ;
// Error type
pub use ;