Skip to main content
Log in

Accelerating all-pairs shortest path algorithms for bipartite graphs on graphics processing units

  • Published:
Multimedia Tools and Applications Aims and scope Submit manuscript

Abstract

Bipartite graphs are used to model and represent many real-world problems in biological and physical sciences. Finding shortest paths in bipartite graphs is an important task and has numerous applications. Different dynamic programming based solutions to find the shortest paths exists which differ on complexity and structure of graph. The computational complexity of these algorithms is a major concern. This work formulates the parallel versions of Floyd-Warshall and Torgasin-Zimmermann algorithms to compute the shortest paths in bipartite graphs efficiently. These algorithms are mapped to graphics processing unit using tropical matrix product. The performance for different realizations and parameters are compared for Floyd-Warshall and Torgasin-Zimmermann algorithms. Parallel implementation of Torgasin-Zimmermann algorithm attained a speed-up factor of almost 274 when compared with serial Floyd-Warshall algorithm for random-generated undirected graphs.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12

Similar content being viewed by others

References

  1. Ali MKM, Kamoun F (1993) Neural networks for shortest path computation and routing in computer networks. IEEE Transactions on Neural Networks 4 (6):941–954

    Article  Google Scholar 

  2. Araujo F, Ribeiro B, Rodrigues L (2001) A neural network for shortest path computation. IEEE Transactions on Neural Networks 12(5):1067–1073

    Article  Google Scholar 

  3. Asratian AS, Denley TM, Häggkvist R (1998) Bipartite graphs and their applications. vol 131 Cambridge University Press

  4. Bellman R (1956) On a routing problem. Tech. rep., DTIC Document

  5. Cha Y (1997) Navigation of a free-ranging mobile robot using heuristic local path-planning algorithm. Robot Comput Integr Manuf 13(2):145–156

    Article  Google Scholar 

  6. Chabini I (1998) Discrete dynamic shortest path problems in transportation applications: Complexity and algorithms with optimal run time. Transportation Research Record: Journal of the Transportation Research Board (1645) 170–175

  7. Chan TM (2007) More algorithms for all-pairs shortest paths in weighted graphs. In: Proceedings of the Thirty-ninth annual ACM symposium on theory of computing, STOC’07, ACM, pp 590–598

  8. Chen YL, Yang HH (2000) Shortest paths in traffic-light networks. Transportation Research Part B: Methodological 34(4):241–253

    Article  Google Scholar 

  9. Chen L (1995) Solving the shortest-paths problem on bipartite permutation graphs efficiently. Inform Process Lett 55(5):259–264

    Article  MathSciNet  Google Scholar 

  10. Chin-Wen H, Chang JM (1999) Solving the all-pairs-shortest-length problem on chordal bipartite graphs. Inform Process Lett 69(2):87–93

    Article  MathSciNet  Google Scholar 

  11. Coppersmith D, Winograd S (1990) Matrix multiplication via arithmetic progressions. J Symb Comput 9(3):251–280

    Article  MathSciNet  Google Scholar 

  12. Desaulniers G, Soumis F (1995) An efficient algorithm to find a shortest path for a car-like robot. IEEE Trans Robot Autom 11(6):819–828

    Article  Google Scholar 

  13. Dehghan A, Banihashemi AH (2019) On computing the multiplicity of cycles in bipartite graphs using the degree distribution and the spectrum of the graph. IEEE Trans Inf Theory 65(6):3778–3789

    Article  MathSciNet  Google Scholar 

  14. Dijkstra EW (1959) A note on two problems in connexion with graphs. Numer Math 1(1):269–271

    Article  MathSciNet  Google Scholar 

  15. Dragan FF (2005) Estimating all pairs shortest paths in restricted graph families: a unified approach. Journal of Algorithms 57(1):1–21

    Article  MathSciNet  Google Scholar 

  16. Foulds LR (2012) Graph theory applications Springer Science & Business Media

  17. Fu L, Sun D, Rilett LR (2006) Heuristic shortest path algorithms for transportation applications: state of the art. Computers & Operations Research 33(11):3324–3343

    Article  Google Scholar 

  18. Floyd RW (1962) Algorithm 97: Shortest path. Commun ACM 5 (6):345–345

    Article  Google Scholar 

  19. Ghoseiri K, Nadjari B (2010) An ant colony optimization algorithm for the bi-objective shortest path problem. Appl Soft Comput 10(4):1237–1246

    Article  Google Scholar 

  20. Hassin R (1992) Approximation schemes for the restricted shortest path problem. Math Oper Res 17(1):36–42

    Article  MathSciNet  Google Scholar 

  21. Harish P, Narayanan PJ (2007) Accelerating large graph algorithms on the GPU using CUDA. In: Proceedings of the 14th international conference on high performance computing, HiPC’07, vol 4873, Springer, pp 197–208

  22. Hanif MK, Zimmermann KH (2017) Accelerating viterbi algorithm on graphics processing units. Computing 99(11):1105–1123

    Article  MathSciNet  Google Scholar 

  23. Hanif MK (2014) Mapping dynamic programming algorithms on graphics processing units. Ph.D. thesis, Institut für Rechnertechnologie, Technische Universität Hamburg-Harburg

  24. Humayun A, Asif M, Hanif MK (2017) Btas: A library for tropical algebra. Int J Comput Sci Inform Secur 14:220–225

    Google Scholar 

  25. Hougardy S (2010) The Floyd–Warshall algorithm on graphs with negative cycles. Inf Process Lett 110(8-9):279–281

    Article  MathSciNet  Google Scholar 

  26. Johnson DB (1977) Efficient algorithms for shortest paths in sparse networks. J ACM 24(1):1–13

    Article  MathSciNet  Google Scholar 

  27. Katz GJ, Kider Jr JT (2008) All-pairs shortest-paths for large graphs on the gpu. In: Proceedings of the 23rd ACM SIGGRAPH/EUROGRAPHICS symposium on graphics hardware, GH’08, pp 47–55

  28. Kirk DB, Hwu WW (2010) Programming massively parallel processors: a hands-on approach. 1st edn Morgan Kaufmann Publishers Inc

  29. Leiserson CE, Rivest RL, Cormen TH, Stein C (2001) Introduction to Algorithms, vol 6. MIT press, Cambridge

    MATH  Google Scholar 

  30. Lund BD, Smith JW (2010) A multi-stage CUDA kernel for Floyd–Warshall. CoRR arXiv:abs/1001.4108abs/1001.4108

  31. Mikhalkin G (2006) Tropical geometry and its applications. In: Proceedings oh the international congress of mathematicians: Madrid, August 22-30, 2006: invited lectures, pp 827–852

  32. Nath R, Tomov S, Dongarra J (2010) An improved Magma Gemm for Fermi graphics processing units. International Journal of High Performance Computing Applications 24(4):511–515

    Article  Google Scholar 

  33. NVIDIA: NVIDIA CUDA Compute Unified Device Architecture Programming Guide (2016)

  34. Okuyama T, Ino F, Hagihara K (2012) A task parallel algorithm for finding all-pairs shortest paths using the GPU. International Journal of High Performance Computing and Networking 7(2):87–98

    Article  Google Scholar 

  35. Pachter L, Sturmfels B (2005) Algebraic statistics for computational biology. Cambridge University Press

  36. Roditty L, Shapira A (2011) All-pairs shortest paths with a sublinear additive error. ACM Transactions on Algorithms 7(4):45:1–45:12

    Article  MathSciNet  Google Scholar 

  37. Richter-Gebert J, Sturmfels B, Theobald T (2005) First steps in tropical geometry. Contemp Math 377:289–318

    Article  MathSciNet  Google Scholar 

  38. Romani F (1980) Shortest-path problem is not harder than matrix multiplication. Inf Process Lett 11(3):134–136

    Article  MathSciNet  Google Scholar 

  39. Seidel R (1992) On the all-pairs-shortest-path problem. In: Proceedings of the Twenty-fourth annual ACM symposium on theory of computing, STOC’92, ACM, pp 745–749

  40. Strassen V (1969) Gaussian elimination is not optimal. Numer Math 13:354–356

    Article  MathSciNet  Google Scholar 

  41. Takaoka T, Hashim M (2010) A simpler algorithm for the all pairs shortest path problem with o(n2logn) expected time. In: Proceedings of the 4th international conference on combinatorial optimization and applications, COCOA’10, Springer, pp 195–206

  42. Torgasin S, Zimmermann KH (2013) An all-pairs shortest path algorithm for bipartite graphs. Central European Journal of Computer Science 3 (4):149–157

    MATH  Google Scholar 

  43. Takaoka T (2013) A simplified algorithm for the all pairs shortest path problem with o(n2logn) expected time. J Comb Optim 25(2):326–337

    Article  MathSciNet  Google Scholar 

  44. Warshall S (1962) A theorem on boolean matrices. J ACM 9(1):11–12

    Article  MathSciNet  Google Scholar 

  45. Weisstein EW (2002) Complete bipartite graph

  46. Yu F, Li Y, Wu TJ (2010) A temporal ant colony optimization approach to the shortest path problem in dynamic scale-free networks. Physica A: Statistical Mechanics and its Applications 389(3):629–636

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Muhammad Kashif Hanif.

Additional information

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Appendix

Appendix

Listing 1
figure e

m − 1 GPU kernel invocations for FloydWarshallMatrixMul algorithm

Listing 2
figure f

log2(m) GPU kernel invocations for FloydWarshallMatrixMul algorithm

Listing 3
figure g

Sample Kernel code for tropical matrix product

Listing 4
figure h

Sample kernel code based on MAGMA BLAS for tropical matrix product

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Hanif, M.K., Zimmermann, KH. & Anees, A. Accelerating all-pairs shortest path algorithms for bipartite graphs on graphics processing units. Multimed Tools Appl 81, 9549–9566 (2022). https://doi.org/10.1007/s11042-022-12066-0

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11042-022-12066-0

Keywords

Navigation