问题标签 [petgraph]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
69 浏览

rust - Petgraph 的 all_simple_paths() 函数需要哪些类型的注释?

我正在尝试使用 Petgraph 的all_simple_paths(),但我不确定需要什么类型的注释,文档没有给出示例。它返回一个impl Iterator<Item = TargetColl>where TargetColl: FromIterator<G::NodeId>,但我不知道我应该为此做什么样的注释。

0 投票
1 回答
77 浏览

rust - 如何在 Rust 中制作带有字符串节点的未加权无向图?

我想在 Rust 中创建一个带有字符串节点的未加权、无向图。我一直在尝试使用petgraph和上from_edges提供的构造方法UnGraph,但我无法这样做,因为&str它不是有效的 NodeIndex。有没有更简单的方法来做到这一点?