Functional Correctness of C Implementations of Dijkstra's, Kruskal's, and Prim's Algorithms
Anshuman Mohan, Wei Xiang Leow, Aquinas Hobor
摘要
Abstract We develop machine-checked verifications of the full functional correctness of C implementations of the eponymous graph algorithms of Dijkstra, Kruskal, and Prim. We extend Wang et al.’s CertiGraph platform to reason about labels on edges, undirected graphs, and common spatial representations of edge-labeled graphs such as adjacency matrices and edge lists. We certify binary heaps, including Floyd’s bottom-up heap construction, heapsort, and increase/decrease priority. Our verifications uncover subtle overflows implicit in standard textbook code, including a nontrivial bound on edge weights necessary to execute Dijkstra’s algorithm; we show that the intuitive guess fails and provide a workable refinement. We observe that the common notion that Prim’s algorithm requires a connected graph is wrong: we verify that a standard textbook implementation of Prim’s algorithm can compute minimum spanning forests without finding components first. Our verification of Kruskal’s algorithm reasons about two graphs simultaneously: the undirected graph undergoing MSF construction, and the directed graph representing the forest inside union-find. Our binary heap verification exposes precise bounds for the heap to operate correctly, avoids a subtle overflow error, and shows how to recycle keys to avoid overflow.
问 Lune
几分钟看清这篇 Paper 的位置,不用再花一下午。
Lune 能读引用它和与它最相关的顶会 Paper,讲清它说了什么、后来怎样、哪里站不住,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
相关 Paper
- Universal Optimality of Dijkstra Via Beyond-Worst-Case HeapsBernhard Haeupler, Richard Hladík, Václav Rozhon, Robert E. Tarjan 等FOCS 2024 · 33 次引用
- Deciding memory safety for single-pass heap-manipulating programsUmang Mathur, Adithya Murali, Paul Krogmeier, P. Madhusudan 等POPL 2020 · 11 次引用
- Fully Verified Instruction SchedulingZiteng Yang, Jun Shirako, Vivek SarkarOOPSLA 2024 · 1 次引用
- End-to-End Verification for Subgraph SolvingStephan Gocht, Ciaran McCreesh, Magnus O. Myreen, Jakob Nordström 等AAAI 2024 · 9 次引用
- CompCertELF: verified separate compilation of C programs into ELF object filesYuting Wang, Xiangzhe Xu, Pierre Wilke, Zhong ShaoOOPSLA 2020 · 26 次引用
