Can you solve the virus riddle Lisa Winer

Your research team has found
a prehistoric virus

preserved in the permafrost

and isolated it for study.

After a late night working,

you’re just closing up the lab
when a sudden earthquake hits

and knocks out the power.

As the emergency generators kick in,
an alarm confirms your worst fears:

all the sample vials have broken.

The virus is contained for now,

but unless you can destroy it,

the vents will soon open
and unleash a deadly airborne plague.

Without hesitation, you grab
your HazMat suit

and get ready to save the world.

The lab is a four by four compound
of 16 rooms

with an entrance on the northwest corner
and an exit at the southeast.

Each room is connected to the adjacent
ones by an airlock,

and the virus has been released
in every room except the entrance.

To destroy it, you must enter each
contaminated room

and pull its emergency
self-destruct switch.

But there’s a catch.

Because the security system
is on lockdown,

once you enter the contaminated room,

you can’t exit without
activating the switch,

and once you’ve done so,

you won’t be able to go
back in to that room.

You start to draw out possible
routes on a pad of paper,

but nothing seems to get you
to the exit

without missing at least one room.

So how can you destroy the virus
in every contaminated room

and survive to tell the story?

Pause here if you want
to figure it out for yourself.

Answer in: 3

Answer in: 2

Answer in: 1

If your first instinct is to try to graph
your possible moves on a grid,

you’ve got the right idea.

This puzzle is related to
the Hamiltonian path problem

named after the 19th century Irish
mathematician William Rowan Hamilton.

The challenge
of the path problem

is to find whether a given graph
has a Hamiltonian path.

That’s a route that visits
every point within it exactly once.

This type of problem, classified
as NP-complete,

is notoriously difficult when the graph
is sufficiently large.

Although any proposed solution
can be easily verified,

we have no reliable formula or shortcut
for finding one,

or determining that one exists.

And we’re not even sure
if it’s possible for computers

to reliably find
such solutions, either.

This puzzle adds a twist
to the Hamiltonian path problem

in that you have to start
and end at specific points.

But before you waste a ton of graph paper,

you should know that a true
Hamiltonian path

isn’t possible with these end points.

That’s because the rooms form a grid
with an even number of rooms on each side.

In any grid with that configuration,

a Hamiltonian path that starts and
ends in opposite corners is impossible.

Here’s one way of understanding why.

Consider a checkerboard grid with
an even number of squares on each side.

Every path through it will alternate
black and white.

These grids will all also have an even
total number of squares

because an even number times
and even number is even.

So a Hamiltonian path on an
even-sided grid that starts on black

will have to end on white.

And one that starts on white
will have to end on black.

However, in any grid with even
numbered sides,

opposite corners are the same color,

so it’s impossible to start and end
a Hamiltonian path on opposite corners.

It seems like you’re out of luck,

unless you look at the rules carefully
and notice an important exception.

It’s true that once you activate
the switch in a contaminated room,

it’s destroyed and you can never go back.

But there’s one room
that wasn’t contaminated - the entrance.

This means that you can leave it once
without pulling the switch

and return there when you’ve
destroyed either of these two rooms.

The corner room may have
been contaminated

from the airlock opening,
but that’s okay

because you can destroy the entrance
after your second visit.

That return trip gives you four options
for a successful route,

and a similar set of options if you
destroyed this room first.

Congratulations. You’ve prevented
an epidemic of apocalyptic proportions,

but after such a stressful episode,
you need a break.

Maybe you should take up that recent
job offer to become a traveling salesman.

您的研究小组在永久冻土中发现
了一种史前病毒

并将其分离出来进行研究。

经过一个深夜的工作,

当一场突如其来的地震袭击

并切断了电源时,您正在关闭实验室。

当紧急发生器启动时,
警报证实了您最担心的情况:

所有样品瓶都已破裂。

该病毒目前已被控制,

但除非你能将其摧毁,否则

通风口很快就会打开
并引发致命的空气传播瘟疫。

你毫不犹豫地拿起
你的 HazMat 防护服

,准备好拯救世界。

实验室是一个四乘四的大院
,有 16 个房间

,入口在西北角
,出口在东南角。

每个房间都通过气闸与相邻的房间相连,

除入口外的每个房间都已释放病毒。

要销毁它,您必须进入每个
受污染的房间

并拉动其紧急
自毁开关。

但有一个问题。

因为安全
系统处于锁定状态,

一旦你进入被污染的房间,

你必须打开开关才能离开

,一旦你这样做了,

你就无法再
回到那个房间了。

你开始在一张纸上画出可能的
路线,

但似乎没有什么能让你

不错过至少一个房间的情况下到达出口。

那么,如何才能
在每个被污染的房间里消灭病毒

并存活下来讲述这个故事呢?

如果您想
自己弄清楚,请在此处暂停。

回答:3

回答:2

回答:1

如果您的第一反应是尝试
在网格上绘制可能的移动,

那么您的想法是正确的。

这个谜题与以

19 世纪爱尔兰
数学家威廉·罗文·汉密尔顿命名的哈密顿路径问题有关。 路径问题

的挑战

是找出给定图
是否具有哈密顿路径。

这是一条只访问其中
每个点一次的路线。 当图足够大时,

这类问题被归类
为 NP 完全问题,这

是出了名的困难

尽管任何提议的解决方案
都可以轻松验证,

但我们没有可靠的公式或捷径
来找到一个

或确定一个存在。

我们甚至不确定
计算机是否有可能

可靠地找到
这样的解决方案。

这个谜题为哈密顿路径问题增加了一个转折点

,因为您必须
在特定点开始和结束。

但在你浪费大量方格纸之前,

你应该知道这些端点不可能实现真正的
哈密顿

路径。

那是因为房间形成了一个网格
,每边都有偶数个房间。

在具有该配置的任何网格中,

一条以对角开始和结束的哈密顿路径
是不可能的。

这是理解原因的一种方式。

考虑一个棋盘格,
每边有偶数个正方形。

通过它的每条路径都会交替
黑白。

这些网格也将具有
偶数个正方形,

因为偶数次
和偶数是偶数。

因此
,从黑色开始的均匀网格上的哈密顿路径

必须以白色结束。

一个以白色开始
的必须以黑色结束。

然而,在任何带有
偶数边的网格中,

对角的颜色相同,

因此不可能在对角开始和
结束哈密顿路径。

除非您仔细查看规则
并注意到一个重要的例外,否则您似乎不走运。

确实,一旦您
在受污染的房间中激活开关,

它就会被破坏,您将永远无法回头。

但是有一个
房间没有被污染——入口。

这意味着您可以在
不拉动开关的情况下离开它一次,

然后在您
摧毁这两个房间中的任何一个时返回那里。

角落房间可能已

气闸开口污染,
但这没关系,

因为您可以
在第二次访问后破坏入口。

该回程为您提供了四种
成功路线

的选择,如果您首先摧毁了这个房间,则还有一组类似的选择

恭喜。 你已经阻止
了一场世界末日般的流行病,

但是在经历了如此紧张的一集之后,
你需要休息一下。

也许你应该接受最近的
工作机会,成为一名旅行推销员。