MoonBit Network Analysis Library
MoonetX is an open-source MoonBit library that provides support for network analytic tools.
moon add oboard/moonetx
Graph
fn find_neighbors() -> Array[Int] {
let graph = @nx.Graph::new()
graph.add_nodes_from([0, 1, 2, 3, 4, 5])
graph.add_edges_from([(1, 2), (2, 5)])
graph.neighbors(2)
}
DiGraph
fn get_in_degree() -> Int {
let graph = @nx.DiGraph::new()
graph.add_nodes_from([0, 1, 2, 3, 4, 5])
graph.add_edges_from([(1, 2), (2, 5)])
graph.in_degree(2)
}
Output: 1
Contributions, issues and feature requests are welcome!<
Feel free to check issues page.
This project is MIT licensed.