Finding the Smallest H-Subgraph in Real Weighted Graphs and Related Problems

  • Virginia Vassilevska
  • Ryan Williams
  • Raphael Yuster
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4051)


Let G be a graph with real weights assigned to the vertices (edges). The weight of a subgraph of G is the sum of the weights of its vertices (edges). The MIN H-SUBGRAPH problem is to find a minimum weight subgraph isomorphic to H, if one exists. Our main results are new algorithms for the MIN H-SUBGRAPH problem. The only operations we allow on real numbers are additions and comparisons. Our algorithms are based, in part, on fast matrix multiplication.

For vertex-weighted graphs with n vertices we obtain the following results. We present an O(nt(ω,h)) time algorithm for MIN H-SUBGRAPH in case H is a fixed graph with h vertices and ω< 2.376 is the exponent of matrix multiplication. The value of t(ω,h) is determined by solving a small integer program. In particular, the smallest triangle can be found in O(n2 + 1/(4 − ω)) ≤o(n2.616) time, the smallest K4 in O(nω + 1) time, the smallest K7 in O(n4 + 3/(4 − ω)) time. As h grows, t(ω,h) converges to 3h/(6-ω) < 0.828h. Interestingly, only for h = 4,5,8 the running time of our algorithm essentially matches that of the (unweighted) H-subgraph detection problem. Already for triangles, our results improve upon the main result of [VW06]. Using rectangular matrix multiplication, the value of t(ω,h) can be improved; for example, the runtime for triangles becomes O(n2.575). We also present an algorithm whose running time is a function of m, the number of edges. In particular, the smallest triangle can be found in O(m(18 − 4ω)/(13 − 3ω)) ≤o(m1.45) time.

For edge-weighted graphs we present an O(m2 − 1/k logn) time algorithm that finds the smallest cycle of length 2k or 2k-1. This running time is identical, up to a logarithmic factor, to the running time of the algorithm of Alon et al. for the unweighted case. Using the color coding method and a recent algorithm of Chan for distance products, we obtain an O(n3/logn) time randomized algorithm for finding the smallest cycle of any fixed length.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [AN96]
    Alon, N., Naor, M.: Derandomization, witnesses for Boolean matrix multiplication and construction of perfect hash functions. Algorithmica 16, 434–449 (1996)MATHCrossRefMathSciNetGoogle Scholar
  2. [AYZ95]
    Alon, N., Yuster, R., Zwick, U.: Color-coding. Journal of the ACM 42, 844–856 (1995)MATHCrossRefMathSciNetGoogle Scholar
  3. [AYZ97]
    Alon, N., Yuster, R., Zwick, U.: Finding and counting given length cycles. Algorithmica 17, 209–223 (1997)MATHCrossRefMathSciNetGoogle Scholar
  4. [BFPSS05]
    Bender, M., Farach-Colton, M., Pemmasani, G., Skiena, S., Sumazin, P.: Lowest common ancestors in trees and directed acyclic graphs. J. Algorithms 57(2), 75–94 (2005)MATHCrossRefMathSciNetGoogle Scholar
  5. [Ch05]
    Chan, T.M.: All-Pairs Shortest Paths with Real Weights in O(n 3/logn) Time. In: Dehne, F., López-Ortiz, A., Sack, J.-R. (eds.) WADS 2005. LNCS, vol. 3608, pp. 318–324. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  6. [CN85]
    Chiba, N., Nishizeki, L.: Arboricity and subgraph listing algorithms. SIAM Journal on Computing 14, 210–223 (1985)MATHCrossRefMathSciNetGoogle Scholar
  7. [Cop97]
    Coppersmith, D.: Rectangular matrix multiplication revisited. Journal of Complexity 13, 42–49 (1997)MATHCrossRefMathSciNetGoogle Scholar
  8. [CW90]
    Coppersmith, D., Winograd, S.: Matrix multiplication via arithmetic progressions. J. Symbol. Comput. 9, 251–280 (1990)MATHCrossRefMathSciNetGoogle Scholar
  9. [DF95]
    Downey, R.G., Fellows, M.R.: Fixed-parameter tractability and completeness II. On completeness for W[1] 141(1-2), 109–131 (1995)MATHMathSciNetGoogle Scholar
  10. [EG04]
    Eisenbrand, F., Grandoni, F.: On the complexity of fixed parameter clique and dominating set. Theoret. Comput. Sci. 326(1-3), 57–67 (2004)MATHCrossRefMathSciNetGoogle Scholar
  11. [FKP01]
    Feige, U., Kortsarz, G., Peleg, D.: The Dense k-Subgraph Problem. Algorithmica 29(3), 410–421 (2001)MATHCrossRefMathSciNetGoogle Scholar
  12. [Fr76]
    Fredman, M.L.: New bounds on the complexity of the shortest path problem. SIAM Journal on Computing 5, 49–60 (1976)CrossRefMathSciNetGoogle Scholar
  13. [Fr76a]
    Fredman, M.L.: How good is the information theory bound in sorting? Theoret. Comput. Sci. 1, 355–361 (1976)MATHCrossRefMathSciNetGoogle Scholar
  14. [Ha98]
    Håstad, J.: Clique is hard to approximate within n 1 − ε. Acta Math. 182(1), 105–142 (1998)CrossRefGoogle Scholar
  15. [HP98]
    Huang, X., Pan, V.Y.: Fast rectangular matrix multiplications and applications. Journal of Complexity 14, 257–299 (1998)MATHCrossRefMathSciNetGoogle Scholar
  16. [IR78]
    Itai, A., Rodeh, M.: Finding a minimum circuit in a graph. SIAM Journal on Computing 7, 413–423 (1978)MATHCrossRefMathSciNetGoogle Scholar
  17. [KKM00]
    Kloks, T., Kratsch, D., Müller, H.: Finding and counting small induced subgraphs efficiently. Inf. Process. Lett. 74(3-4), 115–121 (2000)CrossRefGoogle Scholar
  18. [KL05]
    Kowaluk, M., Lingas, A.: LCA Queries in Directed Acyclic Graphs. In: Caires, L., Italiano, G.F., Monteiro, L., Palamidessi, C., Yung, M. (eds.) ICALP 2005. LNCS, vol. 3580, pp. 241–248. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  19. [NP85]
    Nešetřil, J., Poljak, S.: On the complexity of the subgraph problem. Comment. Math. Univ. Carolin. 26(2), 415–419 (1985)MATHMathSciNetGoogle Scholar
  20. [PV91]
    Plehn, J., Voigt, B.: Finding Minimally Weighted Subgraphs. In: Proceedings of the 16th International Workshop on Graph-Theoretic Concepts in Computer Science (WG), Springer, Heidelberg (1991)Google Scholar
  21. [Sei95]
    Seidel, R.: On the All-Pairs-Shortest-Path Problem in Unweighted Undirected Graphs. J. Comput. Syst. Sci. 51(3), 400–403 (1995)CrossRefMathSciNetGoogle Scholar
  22. [VW06]
    Vassilevska, V., Williams, R.: Finding a maximum weight triangle in n 3 − δ time, with applications. In: Proceedings of the 38th Annual ACM Symposium on Theory of Computing (STOC) (to appear)Google Scholar
  23. [YZ04]
    Yuster, R., Zwick, U.: Detecting short directed cycles using rectangular matrix multiplication and dynamic programming. In: Proc. of the 15th ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 247–253. ACM/SIAM (2004)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Virginia Vassilevska
    • 1
  • Ryan Williams
    • 1
  • Raphael Yuster
    • 2
  1. 1.Computer Science DepartmentCarnegie Mellon UniversityPittsburgh
  2. 2.Department of MathematicsUniversity of HaifaHaifaIsrael

Personalised recommendations