English 中文(简体)
找到一条算法来赢得这场打击犯罪的斗争!
原标题:Find an algorithm to win this battle against crime!

在一个城市犯下的罪行和嫌疑人开始逃跑。 提供了该城市的地图。 目前,某些地方有一些警车,试图阻止嫌疑人。 警察和嫌疑人的车速率相同。 嫌疑人只有在与任何警车较早时才能到达。 地图上有几处空白,如果嫌疑人到达其中,他就会躲避。 提供一种计算法,将警察的汽车分配起来,使嫌疑人无法逃脱。

例如,下文是一份可能的城市地图。

enter image description here

White circle is where the suspect starts, black circles are police cars, and little squares are exits. In this situation, suspect can be stopped. A possible plan is police car A goes to A , B stays and C goes to C .


对我的问题的描述类似:

一家化学工厂(由白色圈子标明)在每一可能方向飞行,其最大速度是<代码>v,救援队(由黑圈标明)也在试图阻挡。 他们保护的村民很少。


<>My Thoughts

如果我们有<代码>n的警用车辆,那么一个非常低的办法是列出所有可能的<代码>k<>/code>-element subsetsP的vert:

a)k <=n;

b) 在地图上删除<代码>P中的所有vert,将使嫌疑人无法撤离;

c) Remove any proper subset of P will let at least one exit reachable to the suspect.

然后,我们可以轻易确定<代码>中的每一条vert。 P可在警方控制下,不得晚于嫌疑人。

但我如何列出所有可能的<代码>。 P ?


<>0> Lior Kogan:

看看这一地图:

“entergraph

如果这是双方了解其他战略的转折游戏,警察会获胜,因为他可以守护嫌疑人的一方。

But in my problem, the police loses because he ll never know which side the suspect may choose.

最佳回答

Now I have a clearer view of my problem. Although simpler than the Cops and Robbers Game or Graph Guarding game, it is nevertheless an NP-hard problem.

这个问题实际上可以分为两项单独的任务:

Task a) Find a possible set of vertices that cuts the suspect unreachable to any exits.
Task b) Validate if this set of vertices can be all in-timely covered by police cars.

现在我们将证明,Task a) 是NP-complete。

第一,我们只考虑一次撤出。 看看这一简单地图:

“entergraph

Assign False to a vertex if it isrup by police and 真的,如果该编码是可兑换的。 我们知道,如果<代码>,嫌疑人可以躲避。 A & (B ́D) & C = 真正的。 现在我们清楚地看到,Task a)相当于著名的NP-complete Boolean satisfiability problem

如果我们有几次出走,就简单地制造了几条风气,并将其与<条码>AND(&)连接起来。

Hungarian算法易于解决。 时间复杂性是O(n^4)

So this whole problem is an NP-hard.

问题回答

www.un.org/Depts/DGACM/index_spanish.htm Edit2: 根据您的说明:

我找不到任何关于问题的确切问题的研究。

另一个密切相关的议题是<>网络中的病毒传播和接种。 以下是一些论文:

我认为,所提出的问题非常令人感兴趣。 尽管我相信这是进步党。

因不能再帮助而去。

纽约总部

www.un.org/Depts/DGACM/index_spanish.htm Edit1: Changed from Cops and Robberslyn to Graph careing competition

<>新回答:

这是的备选案文。 制图游戏

一支称为警卫的机动特工队试图阻止所有可能的袭击,以阻止入侵一个指定地区。 在这种背景下的图表模型中,代理人和入侵者位于图表的外vert上,通过连接边缘从 no到 no。

See: Guard Club ongraphs and

在您的备选案文中,有两种差异:

  • You are trying to guard more than one area
  • Each guarded area is a single node

纽约总部

Original answer:

This is a variant of the well studied Cops and Robbers game.

哥普和罗伯斯的游戏是在无方向的图表上进行的,其中一群ps试图追捕抢劫者。 1980年代,Winkler-Nowakowski和Quilliot独立界定了游戏,自那时以来,进行了密集的研究。 尽管如此,计算的复杂性仍是一个开放的问题。

The problem of determining if k cops can capture a robber on an undirected graph, as well as the problem of computing the minimum number of cops that can catch a robber on a given graph were proven to be NP-hard.

以下是一些资源:





相关问题
How to add/merge several Big O s into one

If I have an algorithm which is comprised of (let s say) three sub-algorithms, all with different O() characteristics, e.g.: algorithm A: O(n) algorithm B: O(log(n)) algorithm C: O(n log(n)) How do ...

Grokking Timsort

There s a (relatively) new sort on the block called Timsort. It s been used as Python s list.sort, and is now going to be the new Array.sort in Java 7. There s some documentation and a tiny Wikipedia ...

Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

Enumerating All Minimal Directed Cycles Of A Directed Graph

I have a directed graph and my problem is to enumerate all the minimal (cycles that cannot be constructed as the union of other cycles) directed cycles of this graph. This is different from what the ...

Quick padding of a string in Delphi

I was trying to speed up a certain routine in an application, and my profiler, AQTime, identified one method in particular as a bottleneck. The method has been with us for years, and is part of a "...

热门标签