Skip to main content

This site is currently under development.

On this page

Ferrying the Deceased

Betal has picked up a part-time job that involves ferrying $n$ deceased people across a river for a smooth transition into the next phase. Certain pairs of these people are sworn enemies, who cannot be taken together on the ferry because when on water, they can in fact get into a deadly fight, and this will be a distraction to Betal who will be navigating rough waters. It is safe to leave them on the shore because corpses don't fight on land.

The ferry has unlimited capacity, but Betal has limited time.

Input: Integers $k$ and $n$, and an $n$-vertex graph $G$ describing the pairs of enemies (an edge $(u,v)$ means $u$ and $v$ are enemies).

Output: TRUE if Betal can ferry all $n$ people across the river safely in at most $k$ rounds, FALSE otherwise.

Part A

Consider 5 people: $A, B, C, D, E$ with the following enemy pairs:

$$\{A,B\}, \{B,C\}, \{C,D\}, \{D,E\}, \{E,A\}$$

(This forms a 5-cycle.)

What is the minimum number of ferry trips needed to transport everyone safely?

Part B

Is this decision problem NP-hard in general?

Hints
  1. Think about which people can safely travel together (no edge between them).