Calculating Graph Algorithms for Dominance and Shortest Path

  • Ilya Sergey
  • Jan Midtgaard
  • Dave Clarke
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7342)


We calculate two iterative, polynomial-time graph algorithms from the literature: a dominance algorithm and an algorithm for the single-source shortest path problem. Both algorithms are calculated directly from the definition of the properties by fixed-point fusion of (1) a least fixed point expressing all finite paths through a directed graph and (2) Galois connections that capture dominance and path length.

The approach illustrates that reasoning in the style of fixed-point calculus extends gracefully to the domain of graph algorithms. We thereby bridge common practice from the school of program calculation with common practice from the school of static program analysis, and build a novel view on iterative graph algorithms as instances of abstract interpretation.


graph algorithms dominance shortest path algorithm fixed-point fusion fixed-point calculus Galois connections 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Aarts, C., Backhouse, R.C., Boiten, E.A., Doornbos, H., van Gasteren, N., van Geldrop, R., Hoogendijk, P.F., Voermans, E., van der Woude, J.: Fixed-point calculus. Information Processing Letters 53, 131–136 (1995)MathSciNetCrossRefGoogle Scholar
  2. 2.
    Allen, F.E.: Control flow analysis. SIGPLAN Not. 5, 1–19 (1970)CrossRefGoogle Scholar
  3. 3.
    Allen, F.E., Cocke, J.: Graph theoretic constructs for program control flow analysis. Technical Report IBM Research Report RC 3923, Thomas J. Watson Research Center, Yorktown Heights, NY, USA (1972)Google Scholar
  4. 4.
    Alstrup, S., Harel, D., Lauridsen, P.W., Thorup, M.: Dominators in linear time. SIAM J. Comput. 28(6), 2117–2132 (1999)MathSciNetzbMATHCrossRefGoogle Scholar
  5. 5.
    Appel, A.W.: Modern Compiler Implementation in {C, Java, ML}. Cambridge University Press, New York (1998)Google Scholar
  6. 6.
    Backhouse, R.: Chapter 4: Galois Connections and Fixed Point Calculus. In: Backhouse, R., Crole, R.L., Gibbons, J. (eds.) Algebraic and Coalgebraic Methods in the Mathematics of Program Construction. LNCS, vol. 2297, pp. 89–148. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  7. 7.
    Backhouse, R.C.: Regular algebra applied to language problems. J. Log. Algebr. Program. 66(2), 71–111 (2006)MathSciNetzbMATHCrossRefGoogle Scholar
  8. 8.
    Backhouse, R.C., Carré, B.A.: Regular algebra applied to path-finding problems. Journal of the Institute of Mathematics and Applications 15, 161–186 (1975)zbMATHCrossRefGoogle Scholar
  9. 9.
    Backhouse, R.C., van den Eijnde, J.P.H.W., van Gasteren, A.J.M.: Calculating path algorithms. Sci. Comput. Program. 22(1-2), 3–19 (1994)zbMATHCrossRefGoogle Scholar
  10. 10.
    Barbuti, R., Bernardeschi, C., De Francesco, N.: Checking security of Java bytecode by abstract interpretation. In: Proceedings of the 2002 ACM Symposium on Applied Computing, Madrid, Spain, pp. 229–236. ACM (March 2002)Google Scholar
  11. 11.
    Bellman, R.: On a routing problem. Quarterly of Applied Mathematics 16, 87–90 (1958)MathSciNetzbMATHGoogle Scholar
  12. 12.
    Bird, R., de Moor, O.: The Algebra of Programming. Prentice-Hall (1996)Google Scholar
  13. 13.
    Cai, J., Paige, R.: Program derivation by fixed point computation. Sci. Comput. Program. 11(3), 197–261 (1989)MathSciNetzbMATHCrossRefGoogle Scholar
  14. 14.
    Carré, B.A.: An algebra for network routing problems. J. Inst. Maths Applics. 7, 273–294 (1971)zbMATHCrossRefGoogle Scholar
  15. 15.
    Cooper, K.D., Harvey, T.J., Kennedy, K.: A simple, fast dominance algorithm. Technical report, Rice University Houston, Texas, USA (2001)Google Scholar
  16. 16.
    Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 2nd edn. McGraw-Hill Higher Education (2001)Google Scholar
  17. 17.
    Cousot, P.: Semantic foundations of program analysis. In: Muchnick, S.S., Jones, N.D. (eds.) Program Flow Analysis: Theory and Applications, ch. 10, pp. 303–342. Prentice-Hall (1981)Google Scholar
  18. 18.
    Cousot, P.: The calculational design of a generic abstract interpreter. In: Broy, M., Steinbrüggen, R. (eds.) Calculational System Design. NATO ASI Series F. IOS Press, Amsterdam (1999)Google Scholar
  19. 19.
    Cousot, P.: Constructive design of a hierarchy of semantics of a transition system by abstract interpretation. Theoretical Comput. Sci. 277(1-2), 47–103 (2002)MathSciNetzbMATHCrossRefGoogle Scholar
  20. 20.
    Cousot, P., Cousot, R.: Static determination of dynamic properties of programs. In: Proceedings of the Second International Symposium on Programming, Dunod, Paris, France, pp. 106–130 (1976)Google Scholar
  21. 21.
    Cousot, P., Cousot, R.: Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In: Sethi, R. (ed.) Proceedings of the Fourth Annual ACM Symposium on Principles of Programming Languages, Los Angeles, California, pp. 238–252 (January 1977)Google Scholar
  22. 22.
    Cousot, P., Cousot, R.: Systematic design of program analysis frameworks. In: Rosen, B.K. (ed.) Proceedings of the Sixth Annual ACM Symposium on Principles of Programming Languages, San Antonio, Texas, pp. 269–282 (January 1979)Google Scholar
  23. 23.
    Cousot, P., Cousot, R.: Abstract interpretation and application to logic programs. Journal of Logic Programming 13(2-3), 103–179 (1992)MathSciNetzbMATHCrossRefGoogle Scholar
  24. 24.
    Cousot, P., Cousot, R.: Abstract interpretation frameworks. Journal of Logic and Computation 2(4), 511–547 (1992)MathSciNetzbMATHCrossRefGoogle Scholar
  25. 25.
    Cousot, P., Cousot, R.: Systematic design of program transformation frameworks by abstract interpretation. In: Mitchell, J.C. (ed.) Proceedings of the 29th Annual ACM Symposium on Principles of Programming Languages, Portland, Oregon, pp. 178–190 (January 2002)Google Scholar
  26. 26.
    Cousot, P., Cousot, R.: Basic concepts of abstract interpretation. In: Jacquart, R. (ed.) Building the Information Society, pp. 359–366. Kluwer Academic Publishers (2004)Google Scholar
  27. 27.
    Davey, B.A., Priestley, H.A.: Introduction to Lattices and Order, 2nd edn. Cambridge University Press, Cambridge (2002)zbMATHCrossRefGoogle Scholar
  28. 28.
    Dijkstra, E.W.: A note on two problems in connexion with graphs. Numerische Mathematik 1, 269–271 (1959)MathSciNetzbMATHCrossRefGoogle Scholar
  29. 29.
    Dummit, D., Foote, R.: Abstract algebra. Prentice Hall (1999)Google Scholar
  30. 30.
    Fluet, M., Weeks, S.: Contification using dominators. In: Leroy, X. (ed.) Proceedings of the Sixth ACM SIGPLAN International Conference on Functional Programming (ICFP 2001), Firenze, Italy, pp. 2–13 (September 2001)Google Scholar
  31. 31.
    Kam, J.B., Ullman, J.D.: Global data flow analysis and iterative algorithms. J. ACM 23, 158–171 (1976)MathSciNetzbMATHCrossRefGoogle Scholar
  32. 32.
    Lengauer, T., Tarjan, R.E.: A fast algorithm for finding dominators in a flowgraph. ACM Trans. Program. Lang. Syst. 1, 121–141 (1979)zbMATHCrossRefGoogle Scholar
  33. 33.
    Midtgaard, J., Jensen, T.: A Calculational Approach to Control-Flow Analysis by Abstract Interpretation. In: Alpuente, M., Vidal, G. (eds.) SAS 2008. LNCS, vol. 5079, pp. 347–362. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  34. 34.
    Might, M.: Abstract Interpreters for Free. In: Cousot, R., Martel, M. (eds.) SAS 2010. LNCS, vol. 6337, pp. 407–421. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  35. 35.
    Milanova, A., Vitek, J.: Static Dominance Inference. In: Bishop, J., Vallecillo, A. (eds.) TOOLS 2011. LNCS, vol. 6705, pp. 211–227. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  36. 36.
    Prosser, R.T.: Applications of boolean matrices to the analysis of flow diagrams. In: Proceeding of the Eastern Joint IRE-AIEE-ACM Computer Conference, pp. 133–138. ACM, Boston (1959)Google Scholar
  37. 37.
    Schrijver, A.: On the History of Combinatorial Optimization (till 1960). In: Aardal, K., Nemhauser, G.L., Weismantel, R. (eds.) Handbook of Discrete Optimization, pp. 1–68 (2005)Google Scholar
  38. 38.
    Silva, P.F., Oliveira, J.N.: ’Galculator’: functional prototype of a Galois-connection based proof assistant. In: Antoy, S., Albert, E. (eds.) PPDP 2008: Proceedings of the 10th ACM-SIGPLAN International Conference on Principles and Practice of Declarative Programming, pp. 44–55 (July 2008)Google Scholar
  39. 39.
    van den Eijnde, J.P.H.W.: Conservative Fixpoint Functions on a graph. In: Bird, R.S., Morgan, C.C., Woodcock, J.C.P. (eds.) MPC 1992. LNCS, vol. 669, pp. 80–99. Springer, Heidelberg (1993)CrossRefGoogle Scholar
  40. 40.
    van Gasteren, A.J.M.: On the shape of mathematical arguments. Springer-Verlag New York, Inc. (1990)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Ilya Sergey
    • 1
  • Jan Midtgaard
    • 2
  • Dave Clarke
    • 1
  1. 1.KU LeuvenBelgium
  2. 2.Aarhus UniversityDenmark

Personalised recommendations