Please use this identifier to cite or link to this item: https://doi.org/10.1007/978-3-030-81688-9_37
Title: Functional Correctness of C Implementations of Dijkstra’s, Kruskal’s, and Prim’s Algorithms
Authors: Mohan, Anshuman 
Leow, Wei Xiang 
Hobor, Aquinas 
Keywords: Coq
Graph algorithms
Separation logic
VST
Issue Date: 1-Jan-2021
Publisher: Springer Science and Business Media Deutschland GmbH
Citation: Mohan, Anshuman, Leow, Wei Xiang, Hobor, Aquinas (2021-01-01). Functional Correctness of C Implementations of Dijkstra’s, Kruskal’s, and Prim’s Algorithms. Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) 12760 LNCS : 801-826. ScholarBank@NUS Repository. https://doi.org/10.1007/978-3-030-81688-9_37
Rights: Attribution 4.0 International
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. © 2021, The Author(s).
Source Title: Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
URI: https://scholarbank.nus.edu.sg/handle/10635/233875
ISBN: 9.78303E+12
ISSN: 0302-9743
DOI: 10.1007/978-3-030-81688-9_37
Rights: Attribution 4.0 International
Appears in Collections:Staff Publications
Elements

Show full item record
Files in This Item:
File Description SizeFormatAccess SettingsVersion 
10_1007_978-3-030-81688-9_37.pdf700.64 kBAdobe PDF

OPEN

NoneView/Download

Google ScholarTM

Check

Altmetric


This item is licensed under a Creative Commons License Creative Commons