Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Блог пользователя surajkvm007

Автор surajkvm007, история, 9 лет назад, По-английски

can anyone please provide me with a hint to solve this problem

basically we need to find all the cliques in the graph but in short time.

Update : I tried Bron-Kerbosch algorithm but it takes exponential time and the time limit for the problem is 1 sec with maximum of 128 vertices.

  • Проголосовать: нравится
  • -4
  • Проголосовать: не нравится

»
9 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
  • »
    »
    9 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    it takes exponential time and in the problem the time limit is 1 sec with 128 vertices.

    • »
      »
      »
      9 лет назад, # ^ |
      Rev. 4   Проголосовать: нравится +5 Проголосовать: не нравится

      Except you're allowed to terminate the algorithm once you find 1000 cliques. I already got accepted on this problem with the above algorithm, believe me, it's fine. If you're getting TLE you're doing something wrong, my implementation runs in 0.08s on the Kattis servers.

      EDIT: Additionally, you're not going to find subexponential algorithms for this problem, it's NP-Complete.

      EDIT2: iirc, you do need to implement the advanced techniques mentioned on the wiki (pivoting and vertex ordering).