sim_lib_discrete_graph/
cards.rs1#[derive(Debug, Clone, Copy, PartialEq, Eq)]
9pub struct CardSpec {
10 pub key: &'static str,
12 pub summary: &'static str,
14 pub operations: &'static [&'static str],
16 pub data_forms: &'static [&'static str],
18 pub limits: &'static str,
20}
21
22pub fn graph_cards() -> &'static [CardSpec] {
24 const CARDS: &[CardSpec] = &[CardSpec {
25 key: "discrete/graph",
26 summary: "Weighted graphs, certified paths, and minimum-cost assignment.",
27 operations: &[
28 "bfs",
29 "dfs",
30 "connected-components",
31 "weakly-connected-components",
32 "strongly-connected-components",
33 "min-cost-assignment",
34 "verify-assignment",
35 ],
36 data_forms: &["graph", "edge", "cost-matrix", "assignment-certificate"],
37 limits: "Node identity is index-based; multiedges and self-loops are \
38 representable. Connectivity validates endpoints and fails closed \
39 on out-of-range nodes. Assignment uses exact checked additive costs.",
40 }];
41 CARDS
42}
43
44#[cfg(test)]
45mod tests {
46 use super::*;
47
48 #[test]
49 fn graph_card_is_present_and_ascii() {
50 let cards = graph_cards();
51 assert_eq!(cards.len(), 1);
52 assert_eq!(cards[0].key, "discrete/graph");
53 assert!(cards[0].summary.is_ascii());
54 }
55}