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

Автор ShapeBlaze, история, 12 месяцев назад, По-английски

Hi!

One of my students got the following problem on a competition.

Given a undirected graph with $$$N\leq 100$$$ vertices and $$$M\leq 1000$$$ edges. $$$1\leq K\leq N$$$ vertices are considered special and you are given their numbers. Each edge has a "safety" characteristic — a real number between $$$0$$$ and $$$1$$$.

The task is to find the longest cycle, which has at least half of special vertices and the product of safety on the edges is at least $$$0.5$$$.

It seems to me that this problem with $$$K=1$$$ is the same as finding the longest cycle in a graph, but as far as I know this is NP-hard.

Is it unsolvable in polynomial time or did I miss something?

P.S. I have a screenshot of the statement but it is in Russian. If you want — I can post it in the comments, but I warn you — it is very bad:)

Statement in Russian
  • Проголосовать: нравится
  • +11
  • Проголосовать: не нравится

»
12 месяцев назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

I think you should post the screenshot under spoiler

»
12 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by ShapeBlaze (previous revision, new revision, compare).

»
12 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Can the cycle visit the same node multiple times? If not, then like you said for K = 1 and if all the edges have safety 1, the existence of a Hamiltonian cycle can be reduced to checking if that longest valid cycle contains n nodes. And checking if a graph contains a Hamiltonian cycle is NP-Hard

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

    No, a node can not be visited more than once. Thanks for clarification:)

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

      Then I am pretty sure it's NP-hard (at least the version you described in this blog, I can't read the statement you provided).