![]() |
OpenSWMM Engine
6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
|
Functions | |
| int | sortLinks (const int *node1, const int *node2, int n_links, int n_nodes, std::vector< int > &sorted_links) |
| Sort links in topological (upstream→downstream) order. | |
| int openswmm::toposort::sortLinks | ( | const int * | node1, |
| const int * | node2, | ||
| int | n_links, | ||
| int | n_nodes, | ||
| std::vector< int > & | sorted_links | ||
| ) |
Sort links in topological (upstream→downstream) order.
Uses Kahn's algorithm with CSR adjacency from node1/node2. Returns the number of sorted links. If < n_links, a cycle exists.
| node1 | [in] Upstream node index per link. |
| node2 | [in] Downstream node index per link. |
| n_links | Number of links. |
| n_nodes | Number of nodes. |
| sorted_links | [out] Topologically sorted link indices. |