graphix_io
A minimal Rust I/O helper for loading and saving undirected graphs in plain-text edge-list format, built on top of graphix.
Features
-
Read
read<K>(path: &str) -> io::Result<GraphRep<K>>- Parses every valid line of
u v wintoVec<(usize,usize,K)>, then callsGraphRep::from_list. - Trait bounds:
K: FromStr + Copy - Skips blank or malformed lines silently.
-
Write
write<K>(graph: &GraphRep<K>, path: &str) -> io::Result<()>- Emits each original undirected edge exactly once by iterating
graph.id. - Trait bounds:
K: Display + Copy
-
Zero panics on empty files.
-
No hash tables or manual “seen” tracking—just buffered I/O and CSR’s
idarray.
Installation
[]
= "0.3"
= "0.4"
Or via Cargo:
Usage
Input format
Plain-text file where each line is:
<u> <v> <w>
<u>,<v>areusizevertex IDs<w>is your weight typeK::from_strparses
Blank or malformed lines are skipped.
Example
use GraphRep;
use ;
Run with:
API
License
This project is licensed under the MIT License. See the LICENSE file for details.