Abstract 1 Introduction 2 Preliminaries 3 Hereditary Properties 4 Connected Ferry Cover: Boat-1 Graphs 5 Connected Ferry Cover on Trees 6 Concluding Remarks References

Ferry Cover with Connectivity Constraints

Niranjan Balachandran ORCID IIT Bombay, India Ankita Dargad ORCID IIT Bombay, India Urban Larsson ORCID IIT Bombay, India Neeldhara Misra ORCID IIT Gandhinagar, India Umesh Shankar ORCID IIT Bombay, India
Abstract

The classical Ferry Cover problem asks for the minimum boat capacity needed to transport all vertices of a graph across a river such that no edge remains on either bank at any time – a requirement that the banks induce stable (independent) sets. We study a natural generalization in which the banks must satisfy an arbitrary graph property. For hereditary properties such as acyclicity or planarity, we show that the structural characterization of small-boat and large-boat graphs established by Csorba, Hurkens, and Woeginger extends directly.

We then turn to the connected-bank variant, where the property of interest – connectedness – is not hereditary: both banks must induce connected subgraphs throughout the transfer. We provide a complete characterization of graphs that can be transferred with a boat of size one (boat-1 graphs): a connected graph is boat-1 if and only if its block-cut tree is a path. This characterization yields a linear-time recognition algorithm. As a consequence, we show that every biconnected graph is boat-1, since such graphs admit an st-numbering. We also develop an efficient algorithm for determining the boat number of trees. Our work opens new directions for river-crossing problems under non-hereditary bank constraints.

Keywords and phrases:
ferry cover, river crossing, block-cut tree, st-numbering, hereditary graph property, connectivity
Copyright and License:
[Uncaptioned image] © Niranjan Balachandran, Ankita Dargad, Urban Larsson, Neeldhara Misra, and Umesh Shankar; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Graph algorithms analysis
; Mathematics of computing Graph theory
Acknowledgements:
The authors thank Arjun Arul for very helpful discussions towards arguing that there exist optimal schedules that do not ferry people back. We also acknowledge the use of Claude in the generation of TikZ code and editorial inputs on the writeup, and Gemini Nano Banana for generating the image in the introduction.
Editor:
John Iacono

1 Introduction

Refer to caption
Figure 1: In Alcuin’s classical river crossing puzzle, a farmer must transport a wolf, a goat, and a cabbage across a river using a boat that can carry only one item at a time, ensuring that incompatible pairs (wolf–goat, goat–cabbage) are never left alone together.

The classical Alcuin’s River Crossing Problem, in which a man must transport a wolf, a goat, and a bundle of cabbages across a river without leaving incompatible pairs together, is among the earliest known combinatorial puzzles. The incompatible pairs are (wolf, goat) and (goat, cabbages), as the wolf would eat the goat and the goat would eat the cabbages if left together on any bank without human supervision. Formally, the puzzle can be modeled by a graph on three vertices (wolf, goat, cabbages), where the edges represent mutual incompatibilities. The goal is to move all vertices from one bank to the other using a boat of limited capacity, ensuring that two adjacent vertices are not left together on the same bank at any point.

This problem was first generalized by Lampis and Mitsou [3], who asked for the smallest boat capacity b (excluding the sailor’s seat) for a given graph G=(V,E) that allows all vertices of G to be transferred from one bank to the other without ever leaving an edge of G on a bank. They called it the Ferry Cover (FC) problem and established the following tight relation between the ferry cover number b and the vertex cover number OPTVC(G):

OPTVC(G)bOPTVC(G)+1.

A graph is called small-boat if the boat capacity required is exactly equal to its vertex cover number; otherwise, it is called large-boat. They proved that computing OPTFC(G) is NP-hard and APX-hard in general.

Following this foundational work, Csorba, Hurkens, and Woeginger [1] provided a structural characterization of small-boat graphs. Seify and Shahmohamad [5] extended these results by identifying additional graph classes where the Alcuin number coincides with the vertex cover number. Ito, Langerman, and Yoshida [2] proposed generalized river-crossing models that unify various well-known puzzles in this area and studied their algorithmic complexity. More recently, Shan and Kang [6] analyzed the Ferry Cover problem on regular and small-degree graphs.

Collectively, these works offer a strong characterization of small-boat and large-boat graphs for Ferry Cover problems where the required graph property on each bank is stability or independence. This naturally raises the question of how the problem behaves under alternative constraints on the banks, for instance, when the induced subgraphs on each bank must satisfy connectedness, acyclicity, or planarity. To motivate the need for considering other graph properties, let us introduce a new problem from a more intuitive perspective. Imagine a community living on one bank of a river that wishes to cross to the other side. Not everyone in the community knows each other directly, yet the community as a whole remains cohesive – there is always a chain of people linking any two individuals. However, if two groups of people have no such link between them, they may start seeing each other as strangers or even as threats to the community, which can lead to conflict.

The community wants to build the smallest possible boat, since each extra seat adds a lot to the cost, such that the sailor can ferry everyone across the river while making sure that at every step of the process, the people left on each bank still form a socially connected group. If at any point the people on one bank become split into mutually disconnected subgroups, the peace of the community may be disturbed. This story motivates studying a new variant of the classical Ferry Cover problem, where the requirement on each bank is not stability but connectedness. In graph-theoretic terms, we may view each individual as a vertex, and an edge connects two vertices if the corresponding individuals know each other directly. The goal is to determine the smallest boat capacity that allows all vertices of a connected graph G to be transferred from one bank to the other, such that at every step, the subgraphs induced by the vertices on both banks remain connected. We refer to this model as the connected-bank variant of the Ferry Cover problem.

In this paper, we first focus on hereditary graph properties such as acyclicity and planarity. These are properties that, if satisfied by a graph, are also satisfied by all of its subgraphs. We prove that the structural theorem given by Csorba et al. [1] also holds when the required property on each bank is a hereditary property.

This naturally leads to the question of what happens when the property required on the banks is not hereditary. The story above already illustrates one such case, where the property of interest is connectedness. Here, we assume G is connected, and we say that G is boat-n if n is the minimum boat size sufficient to transfer all vertices of G across the river while preserving connectivity on both banks at all times.

Our main result provides a complete characterization of boat-1 graphs: a connected graph G is boat-1 if and only if its block-cut tree forms a path. This structural insight yields not only an exact combinatorial description but also algorithmic consequences, enabling linear-time recognition of boat-1 graphs. We also develop an efficient algorithm for determining the boat number of trees. We believe this work extends the foundational landscape of Ferry Cover and opens up new directions for variants in which the bank property is neither hereditary nor trivial.

Related Work

The Ferry Cover problem originates from the classical river crossing puzzle attributed to Alcuin of York (circa 8th century), which can be modeled as transferring vertices of a conflict graph where edges represent incompatible pairs that cannot be left together unsupervised. Lampis and Mitsou [3] formalized this as the Ferry Cover problem, establishing the fundamental bound τ(G)c(G)τ(G)+1 relating the Alcuin number c(G) to the vertex cover number τ(G), and proving NP-hardness and APX-hardness. This dichotomy partitions graphs into class 1 (small-boat, where c(G)=τ(G)) and class 2 (large-boat, where c(G)=τ(G)+1).

Csorba, Hurkens, and Woeginger [1] provided the key structural characterization that precisely distinguishes these classes via a partition condition on stable sets. A necessary condition for class 2 is that G have a unique minimum vertex cover; graphs with multiple minimum covers can swap between them during transfer, avoiding the extra seat. Seify and Shahmohamad [5] gave a classification theorem: G is class 2 if and only if for every pair of independent sets I,JV, the union IJ does not cover all vertices. They also identified additional small-boat graph families. Lampis and Mitsou [3] provided a polynomial-time algorithm for trees, exploiting the tree structure via dynamic programming to determine the Alcuin number. They showed that stars K1,m are class 2 for m3 but class 1 for m2, and that graphs of maximum degree at most 2 (paths and cycles) are always class 1.

Shan and Kang [6] provided a comprehensive classification for regular graphs and graphs with maximum degree at most 5, confirming that all regular bipartite graphs are class 1 (by symmetry of covers) while certain regular non-bipartite graphs can be class 2. Ito, Langerman, and Yoshida [2] proposed a unifying framework for river-crossing puzzles, studying round-trip constrained variants where the number of crossings is limited, and proved these variants are also NP-hard.

Importantly, the Csorba–Hurkens–Woeginger structural theorem is remarkably versatile: as we show in this paper, it extends to any hereditary property P by replacing the vertex cover with a minimum P-deletion set. However, our main focus departs from all prior work by considering a non-hereditary constraint – connectedness – which introduces fundamentally different structural challenges. Unlike the classical setting where the boat number lies in {τ(G),τ(G)+1}, the “boat number” for connectivity is not bounded by any simple deletion-set measure, and the scheduling constraints become significantly more intricate.

2 Preliminaries

Definition 1 (Induced Subgraph).

Let G=(V,E) be a graph and let IV. The induced subgraph of G on I is a graph with vertex set I and edge set consisting of all edges of G with both endpoints in I. It is denoted by GI, or G[I].

Throughout the paper, we do not distinguish between a vertex set IV(G) and the subgraph of G induced by I, and use I to denote both when the meaning is clear from the context.

Definition 2 (Hereditary Property).

A graph property P is hereditary if every induced subgraph of a graph satisfying P satisfies P.

For example, the property of not containing cycle is a hereditary property because if a graph G does not contain any cycle, then any induced subgraph of G also does not contain any cycle. The property of having maximum degree not more than a constant is also a hereditary property. Whereas the property of having a path of length larger than a constant is not a hereditary property. The property connectedness is also not hereditary as subgraph of a connected graph might not be connected.

We denote the set of hereditary properties by 𝒫H.

Definition 3 (biconnected).

A graph is biconnected if removal of any vertex does not disconnect the graph or equivalently, there are two vertex disjoint paths between any two vertices.

Definition 4 (Block).

Blocks are the maximal biconnected components of a graph.

Definition 5 (cut-vertex).

A vertex v of a graph G is called a cut-vertex if removal of v increases the number of connected components of G.

Observation 6.

Two blocks of a graph cannot have more than 1 vertex in common.

Definition 7 (Small-Boat).

A graph G is called small-boat if the boat size required to transfer all vertices of G across the river is equal to the size of the minimum vertex cover.

A graph, which is not small-boat, is called large-boat. Note that we do not need a boat of size greater than 1+ the size of the minimum vertex cover, because we can keep the minimum vertex cover on the boat and transfer the rest of the vertices one by one.

The next theorem characterizes the small and large boat graphs.

Theorem 8 ([1],Theorem 3.1).

A graph G=(V,E) can be transferred across the river with boat of size b1 if and only if there exists five subsets X1,X2,X3,Y1 and Y2 of V such that:

  1. 1.

    X1,X2 and X3 is a partition of a stable set X in G,

  2. 2.

    Y1 and Y2 are non-empty subsets of the set YVX, which satisfies Yb,

  3. 3.

    X1Y1 and X2Y2 are stable sets in G, and

  4. 4.

    Y1+Y2X3.

The original Alcuin’s problem requires the banks to be stable sets but this property can be changed as per the requirement. For example, we might need the graphs on the banks to be connected or to be cycle free, etc. This gives the Alcuin’s problem a completely new direction. We call this new set of Alcuin’s problem as Generalized Alcuin problems. Thanks to [1], the structural theorem (Theorem 8) is so versatile that we can use the same theorem for many problems in Generalized Alcuin problems set. More precisely, whenever the required property P on the banks is hereditary, we can use the same theorem with Y being the subset to be removed so that V\Y satisfies P. We prove this in the next section.

Before moving to the proof of structural theorem for any hereditary property, we review a few notations of [1]. A schedule is a finite sequence of triplets (Lk,Bk,Rk), where Lk,Bk and Rk are the vertices on the left bank, boat and the right bank, respectively, during kth transfer.

Definition 9 (Feasible Schedule with respect to P).

Given a graph G=(V,E), boat size b and a hereditary graph property P, a feasible schedule is a schedule (Lk,Bk,Rk)1kt such that

  1. 1.

    For any k, Lk,Bk and Rk is a partition of V such that both Lk and Rk satisfy P and Bkb;

  2. 2.

    During the first transfer, we do not have anything on the right bank and in the last transfer we do not have anything on the left bank, therefore L1B1=V=BtRt and R1=ϕ=Lt;

  3. 3.

    Odd numbered transfer denotes transfer from left to right bank and even numbered transfer denotes transfer from right to left bank, therefore for even k2, Lk1=Lk and Bk1Rk1=BkRk, and for odd k1, Rk1=Rk and Bk1Lk1=BkLk.

Example 10 (Transferring a 4-cycle with boat size 2).

Consider the cycle C4 on vertices {1,2,3,4} with edges {1,2},{2,3},{3,4},{4,1}. The two diagonal pairs {1,3} and {2,4} are independent sets. With a boat of capacity b=2, we can transfer all vertices while keeping both banks stable (independent) at all times.

3 Hereditary Properties

In this section, we show that the structural characterization of Csorba, Hurkens, and Woeginger [1] extends naturally to any hereditary graph property. We begin by establishing bounds on the boat size in terms of a minimum deletion set.

Observation 11.

Let bP denote the minimum boat size required to transfer G=(V,E) when the required property on the banks is a hereditary property P. Let Y be a smallest subset of V such that the induced subgraph G[VY] satisfies P. Then

|Y|bP|Y|+1.

Proof.

For the lower bound, observe that during the first trip, the sailor must take at least |Y| vertices so that the induced subgraph on the remaining vertices satisfies P. Thus bP|Y|.

For the upper bound, we exhibit a feasible schedule using a boat of size |Y|+1. The sailor keeps Y on the boat permanently and transfers the remaining vertices one at a time using the one free seat. At any point during this process, both banks contain subsets of VY. Since G[VY] satisfies P and P is hereditary, every induced subgraph of G[VY] also satisfies P. Hence bP|Y|+1.

Definition 12 (Small-Boat and Large-Boat with respect to P).

Let P be a hereditary property and let G=(V,E) be a graph. Let Y be a smallest subset of V such that G[VY] satisfies P. We say G is small-boat with respect to P if all vertices can be transferred with a boat of size |Y|; otherwise, G is large-boat with respect to P.

The following theorem generalizes Theorem 8 to arbitrary hereditary properties. The argument is very similar to the proof for the original setting, but we include it here for completeness.

Theorem 13 (Structure Theorem for Hereditary Properties).

Let P𝒫H be a hereditary property. A graph G=(V,E) can be transferred across the river with a boat of size b1, maintaining property P on both banks throughout, if and only if there exist subsets X1,X2,X3,Y1,Y2V such that:

  1. 1.

    X1,X2,X3 partition a set XV where G[X] satisfies P;

  2. 2.

    Y1 and Y2 are non-empty subsets of YVX with |Y|b;

  3. 3.

    G[X1Y1] and G[X2Y2] both satisfy P; and

  4. 4.

    |Y1|+|Y2||X3|.

Proof.

We prove both directions separately.

() Sufficiency.

Suppose subsets X1,X2,X3,Y1,Y2 satisfying conditions (1)–(4) exist. We construct a feasible schedule, illustrated in Figure 2. We use the notation LBR to denote a snapshot where L, B, and R are the vertices on the left bank, boat, and right bank, respectively.

  1. 1.

    Initial transport of Y: Load Y onto the boat and deposit Y1 on the right bank, then return. This yields XYY1Y1. This is valid since |Y|b, and both X and Y1 induce subgraphs satisfying P (by conditions (1) and (3), using heredity).

  2. 2.

    Transfer X𝟏: Since Y1, there is at least one free seat. Transfer elements of X1 one by one from left to right, reaching X2X3YY1Y1X1. Throughout, the left bank contains subsets of X and the right bank contains subsets of X1Y1, both satisfying P by heredity.

  3. 3.

    Exchange via X𝟑: Partition X3 into X31 and X32 with |X31||Y1| and |X32||Y2| (possible by condition (4)). Execute four crossings:

    X2X32 (YY1)X31X1Y1,
    X2X32 YX1X31,
    X2Y2 (YY2)X32X1X31,
    X2Y2 YY2X1X3.

    At each step, both banks contain subsets of sets satisfying P, and the boat carries at most b vertices.

  4. 4.

    Transfer X𝟐: Since Y2, transfer elements of X2 one by one, reaching Y2YY2X.

  5. 5.

    Final transport: Load Y2 and deposit everyone on the right bank.

Figure 2: Schematic of the transfer schedule in the sufficiency proof of Theorem 13. Here Y=(YY1Y2). Each horizontal line represents a river crossing; arrows indicate the direction of travel, labeled with the boat’s contents. The exchange phase (rows 3–4) swaps Y1 and Y2 between the banks while transferring X3.

() Necessity.

Given a feasible schedule (Lk,Bk,Rk)1kt, we construct the required subsets. We may assume Bk1Bk for all k, since consecutive identical boat contents indicate redundant trips.

Let Z be a smallest subset such that G[VZ] satisfies P. By Observation 11, |Z|b. Let Y be any superset of Z with |Y|=b, and set X=VY. Then G[X] satisfies P. We consider three cases.

Case 1: There exists 𝒌 with 𝑳𝒌𝒀 and 𝑹𝒌𝒀.

Set Y1=LkY, Y2=RkY, X1=LkX, X2=RkX, and X3=BkX. Then X1,X2,X3 partition X, satisfying (1). Both Y1 and Y2 are non-empty subsets of Y, satisfying (2). Since Lk=X1Y1 and Rk=X2Y2 must satisfy P (as they are bank contents), condition (3) holds. For (4):

|BkX|+|BkY|b|X3|+(|Y||Y1||Y2|)b=|Y|,

giving |X3||Y1|+|Y2|.

Case 2: There exists 𝟏<𝒌<𝒕 with 𝑩𝒌=𝒀.

Suppose k is even (the odd case is symmetric). Since Bk1Bk=Y, some vertices of Y were on the right bank during trip k1; set Y1=Rk1Y. Similarly, Bk+1Y implies Y2=Lk+1Y.

Every vertex of X lies in exactly one of Lk or Rk. Define X1=Rk1X, X2=Lk+1X, X31=Bk1X, X32=Bk+1X, and X3=X31X32. Conditions (1)–(3) follow from the feasibility of the schedule. Since the sailor dropped X31 and picked up Y1 (filling the boat), we have |X31||Y1|; similarly |X32||Y2|, yielding (4).

Case 3: Neither Case 1 nor Case 2 holds.

Here, for all k, either LkY= or RkY=, and BkY for 1<k<t. Since L1Y (initially all vertices are on the left) and RtY (finally all are on the right), there must be some transition point. A careful analysis shows this contradicts the assumption that neither Case 1 nor Case 2 applies.

4 Connected Ferry Cover: Boat-1 Graphs

We now turn to the main focus of this paper: the connected-bank variant of Ferry Cover. Here, the property of interest, connectedness, is not hereditary, and therefore Theorem 13 does not apply. We restrict attention to connected graphs G, since disconnected graphs trivially fail the connectivity requirement.

Definition 14 (Boat-k Graph).

A connected graph G is boat-k if k is the minimum boat size sufficient to transfer all vertices of G across the river while maintaining connectivity on both banks throughout the process.

Our goal in this section is to completely characterize boat-1 graphs. We begin with two simple but useful observations.

Observation 15.

If G=(V,E) is boat-b, then any graph H=(V,E) with EE is boat-b for some bb.

Proof.

Since H contains all edges of G, any subset of vertices inducing a connected subgraph in G also induces a connected subgraph in H. Thus, any valid transfer schedule for G remains valid for H.

If the graph has a Hamiltonian path, them we can remove consecutive vertices along the path. This leads to the following observation.

Observation 16.

If a graph G has a Hamiltonian path, then G is boat-1.

This observation prompts the question of whether Hamiltonian graphs are the only boat-1 graphs. It turns out that the answer is NO!

Example 17 (A Boat-1 Graph without a Hamiltonian Path).

Consider the graph in Figure 3. This graph can be transferred with a boat of size 1 by following the vertex ordering 1,2,3,4,5,6.

Figure 3: A boat-1 graph without a Hamiltonian path. The labeling 1,2,,6 gives a valid transfer order.

The graph in Figure 3 is biconnected – removing any single vertex leaves it connected. This observation leads to a key structural insight.

Biconnected Graphs and st-Numberings

Recall that a graph is biconnected if the removal of any single vertex does not disconnect it. The crucial tool for understanding boat-1 graphs is the notion of an st-numbering, introduced by Lempel, Even, and Cederbaum [4].

Definition 18 (st-Numbering).

Let G=(V,E) be a graph with |V|=n. An st-numbering of G is a bijection ν:V{1,2,,n} such that for every vertex v with 1<ν(v)<n, there exist neighbors u and w of v with ν(u)<ν(v)<ν(w).

In other words, every vertex except the first and last has both a lower-numbered and a higher-numbered neighbor. The following classical result establishes the existence of st-numberings for biconnected graphs.

Theorem 19 (Lempel–Even–Cederbaum [4]).

Let G=(V,E) be a biconnected graph and let {s,t}E be any edge. Then G admits an st-numbering in which s receives number 1 and t receives number |V|.

The connection to our problem is immediate: an st-numbering provides a transfer order that maintains connectivity.

Lemma 20.

If G=(V,E) admits an st-numbering ν, then for all i{1,,|V|}:

  1. 1.

    the subgraph induced by {v:ν(v)i} is connected; and

  2. 2.

    the subgraph induced by {v:ν(v)i} is connected.

Proof.

We prove (1) by induction on i. For i=1, the subgraph contains a single vertex and is trivially connected. Assume the subgraph induced by vertices numbered 1 through i1 is connected. The vertex v with ν(v)=i has a neighbor u with ν(u)<i (unless i=|V|, in which case v is the last vertex and has a neighbor with smaller number by the st-numbering property). Thus, v is adjacent to the connected subgraph on vertices 1 through i1, so the subgraph on 1 through i is connected.

The proof of (2) is symmetric, proceeding by downward induction from |V|.

Lemma 21.

If a graph admits an st-numbering, then it is boat-1.

Proof.

Let ν be an st-numbering of G. Transfer vertices in the order ν1(1),ν1(2),,ν1(n). After transferring the vertex numbered i, the left bank contains vertices numbered i+1 through n, and the right bank contains vertices numbered 1 through i. By Lemma 20, both subgraphs are connected.

Combining Theorem 19 and Lemma 21 yields:

Corollary 22.

Every biconnected graph is boat-1.

Beyond Biconnected Graphs

Corollary 22 characterizes a large class of boat-1 graphs, but it is not complete. There exist boat-1 graphs that are neither biconnected nor Hamiltonian.

Example 23 (A Non-Biconnected Boat-1 Graph).

The graph in Figure 4(a)(a) is not biconnected (vertex 2 is a cut-vertex) and has no Hamiltonian path, yet it is boat-1: transfer vertices in the order 1,2,3,4,5,6.

(a) Boat-1, not biconnected.
(b) Not boat-1: block has 3 cut-vertices.
(c) Not boat-1: cut-vertex in 4 blocks.
Figure 4: (a) A boat-1 graph that is neither biconnected nor Hamiltonian. (b) A graph where a block contains three cut-vertices. (c) A graph where a cut-vertex belongs to four blocks.

The key to understanding which non-biconnected graphs are boat-1 lies in their block-cut tree structure. Recall that the blocks of a graph are its maximal biconnected subgraphs (including bridges, viewed as biconnected graphs on two vertices).

Definition 24 (Block-Cut Tree).

The block-cut tree of a connected graph G is the bipartite graph T whose vertices are the blocks and cut-vertices of G, with an edge between a block B and a cut-vertex c if and only if cB.

The block-cut tree is indeed a tree (hence the name) and captures how the blocks of G are connected through cut-vertices.

Obstructions to being Boat-1

We now identify structural conditions that prevent a graph from being boat-1.

Lemma 25.

A connected graph G is not boat-1 if either:

  1. 1.

    some block of G contains three or more cut-vertices of G; or

  2. 2.

    some cut-vertex of G belongs to three or more blocks of G.

Proof.

We prove each case by showing that any transfer schedule requires a boat of size at least 2.

Case 1: A block 𝑩 contains cut-vertices 𝒄𝟏,𝒄𝟐,𝒄𝟑 (and possibly more).

Denote the set of cut-vertices of G by C. Consider any transfer schedule and let c be a cut-vertex in B that is neither the first nor the last among {c1,c2,c3} to be transferred. Such a vertex exists since |{c1,c2,c3}|3. At the moment c is transferred, some cut-vertices from B are on the left bank and some are on the right bank.

Since c is a cut-vertex, removal of c divides G into 2 components, say G1 and G2. The block B is contained either in G1 or in G2 but not both, because B is a block. So, without loss of generality, assume that B is contained in G1. This implies C is a subset of vertices of G1 and therefore, during the transfer of u, some vertices of G1 are on the left bank and some on the right bank. Consider the following cases depending upon the time when u is transferred:

  1. 1.

    u is transferred before transferring G2: Just after the transfer of u, G2 and a part of G1 are on the left bank and the two cannot be connected in the absence of u because it contradicts u being the cut-vertex.

  2. 2.

    u is transferred after transferring G2 partially or fully: just before the transfer of u, a part of G1 and G2 are on the right bank and the two cannot be connected in the absence of u because it contradicts u being the cut-vertex.

This contradicts the existence of a feasible schedule with a boat of size 1. This completes the proof of (1).

Case 2: A cut-vertex 𝒗 belongs to blocks 𝑩𝟏,𝑩𝟐,𝑩𝟑 (and possibly more).

In any transfer schedule, consider when v is transferred. By Observation 6, the blocks B1,B2,B3 are pairwise vertex-disjoint except at v. Thus, at the moment v is transferred:

  • If v is transferred before completely transferring at least two blocks, then after v leaves the left bank, at least two blocks (minus v) remain, and they are disconnected.

  • If v is transferred after parts of at least two blocks have reached the right bank, then before v arrives, those partial blocks are disconnected on the right bank.

In either case, connectivity fails without transferring additional vertices alongside v.

Theorem 26.

If the block-cut tree of a connected graph G is not a path, then G is not boat-1.

Proof.

The block-cut tree T is bipartite with blocks on one side and cut-vertices on the other. If T is not a path, then some vertex of T has degree at least 3. If this vertex is a block, then that block contains at least three cut-vertices; if it is a cut-vertex, then that cut-vertex belongs to at least three blocks. By Lemma 25, G is not boat-1.

The Complete Characterization

We now prove that the obstruction identified in Theorem 26 is the only obstruction.

Theorem 27 (Characterization of Boat-1 Graphs).

A connected graph G is boat-1 if and only if its block-cut tree is a path.

Proof.

The “only if” direction is Theorem 26. We prove the “if” direction by showing that G admits an st-numbering, from which boat-1 follows by Lemma 21. Let T be the block-cut tree of G. If G is biconnected, then T consists of a single block, which is trivially a path, and G is boat-1 by Corollary 22. Assume G has at least two blocks. We first establish:

Claim 28.

The endpoints of T are blocks, not cut-vertices.

Proof of Claim.

Suppose an endpoint of T is a cut-vertex c. Then c has degree 1 in T, meaning c belongs to exactly one block B. But then removing c from G cannot disconnect G (since all of G{c} remains within the components attached to B), contradicting that c is a cut-vertex.

Thus T has the structure shown in Figure 5: blocks B1,B2,,Bk connected by cut-vertices c1,c2,,ck1, where ci is the unique vertex shared by Bi and Bi+1.

Figure 5: The block-cut tree of a boat-1 graph is a path alternating between blocks (blue) and cut-vertices (red).

We construct an st-numbering of G by combining st-numberings of the individual blocks.

Claim 29.

G admits an st-numbering.

Proof of Claim.

For each block Bi, we construct an st-numbering with specified endpoints:

  • For B1: Choose any neighbor u of c1 in B1. Since B1 is biconnected, by Theorem 19 there exists an st-numbering of B1 with u numbered 1 and c1 numbered |B1|.

  • For Bi with 1<i<k: We need ci1 numbered first and ci numbered last. If {ci1,ci}E(Bi), apply Theorem 19 directly. Otherwise, temporarily add the edge {ci1,ci} to Bi, obtain an st-numbering, then remove the edge. The st-numbering property is preserved since we only required ci1 and ci to be endpoints.

  • For Bk: Choose any neighbor v of ck1 in Bk. Obtain an st-numbering with ck1 numbered 1 and v numbered |Bk|.

Now combine these numberings. Let ni=|Bi| for each i. For vertices in B1, keep their numbers. For vertices in Bi with i>1, add (n11)+(n21)++(ni11)=j=1i1(nj1) to each number. This offset accounts for the fact that each cut-vertex cj is numbered last in Bj and first in Bj+1, receiving number j=1jnj(j1)=j=1jnjj+1 in the combined numbering.

The resulting numbering is an st-numbering of G: every vertex except the first and last has a smaller-numbered and larger-numbered neighbor (within its block, and the block numberings are compatible at cut-vertices).

By Lemma 21, G is boat-1.

Corollary 30.

There is a linear-time algorithm to determine whether a connected graph is boat-1.

5 Connected Ferry Cover on Trees

In this section, we determine the minimum boat size required to transfer any tree while maintaining connectivity on both banks. The key observation is that trees have a natural “peeling” structure: we can transfer vertices one at a time, starting from a leaf and working inward. However, when removing a vertex would disconnect the remaining graph, we must transfer the orphaned components along with it.

Definition 31 (Demand and Cost).

Let S=(Lk,Bk,Rk) be a schedule for a graph G. The demand, denoted by DG(S) is defined as maxkBk. The cost, denoted by CG(S), is defined as kBk.

We will use D(S) (resp. C(S)) instead of DG(S) (resp. CG(S)) whenever G is clear from the context. Demand is nothing but the minimum boat size required to execute the given schedule and cost is the total amount paid to the sailor if each person pays 1 unit of currency every time (s)he crosses the river.

If each person crosses the river only once in a schedule S of G, the cost C(S) is the same as V(G). Note that this is minimal possible cost as each person has to cross the river at least once.

Definition 32 (Adjacent).

Two mutually disjoint induced connected subgraphs C1 and C2 of a graph G are said to be adjacent if the graph induced by V(C1)V(C2) is connected.

Equivalently, C1 and C2 are adjacent if there exists an edge of G between a vertex of C1 and a vertex of C2. By abuse of language, we sometimes say C1 is adjacent to C2 and vice-versa. By convention, we declare that the empty graph is adjacent to any connected graph, and vice versa.

Let S=(Lk,Bk,Rk)1kt be a schedule of a tree T=(V,E). For any index k, each CC of T[Bk] is adjacent to T[Lk], or to T[Rk], or to both. When no confusion arises, we use the same symbol to denote a vertex subset and the subgraph induced by it.

Let BkL denote the union of vertices of all CCs of Bk that are adjacent to Lk, and let BkR denote the union of vertices of all CCs of Bk that are adjacent to Rk. Since T is acyclic, there can be at most one CC of Bk that is adjacent to both Lk and Rk; denote this component by BkLR. Moreover, if BkLR=, then Lk and Rk are adjacent, as T is connected. This can be visualized in Figure 6.

Definition 33 (Uniformly adjacent).

Given a schedule S=(Lk,Bk,Rk) of a graph, the connected components of Bk are said to be uniformly adjacent: if either all are adjacent to Lk, or all are adjacent to Rk, or all are adjacent to both Lk and Rk.

Given a schedule, if the CCs of Bk are not uniformly adjacent, by abuse of language, we say that the kth trip violates the uniform adjacency property. For brevity, we may also say that Bk is not uniformly adjacent, instead of explicitly referring to its connected components.

(a) When no component of Bk is adjacent to both banks.
(b) When Bk contains a component adjacent to both banks.
Figure 6: The tree T expressed in terms of the partition (Lk,Bk,Rk), together with the adjacencies between these parts; edges indicate adjacency in T.

The following lemma says that any schedule for a tree can be modified such that the contents of the boat are uniformly adjacent. The proof of the lemma is a case wise analysis of the first time the boat is not uniformly adjacent. We see that some vertices carried in that trip are brought back in a future trip, meaning that part of the movement was unnecessary. So, we modify the trips to avoid carrying extra vertices in such a way as to not increase the demand or cost of the schedule. By repeating this process whenever a bad trip appears, we eventually obtain a schedule where the contents of the boat of every trip are uniformly adjacent. We omit the proof here due to page constraints and direct the interested reader to the full version of the paper for a complete proof.

Lemma 34.

Given a schedule S=(Lk,Bk,Rk)1kt of a tree T, there exists another schedule S^=(L^i,B^i,R^i)1it^ of T with demand and cost at most D(S) and C(S), respectively, such that for each i, the connected components of B^i are uniformly adjacent.

In Lemma 34, we showed that for any schedule S, there exists a schedule S^ with cost and demand no greater than those of S, such that in every trip of S^, the boat set is uniformly adjacent. The next lemma strengthens this result. It shows that, starting from S^, we can construct another schedule S¯, again without increasing the cost or demand, such that in each trip of S¯, the boat contains at most one connected component that is adjacent to both banks. Moreover, the boat set of every even-indexed trip in S¯ is empty.

Before moving to the next lemma, we define another property of the boat set, called bi-adjacency.

Definition 35 (Bi-adjacent).

Given a schedule S=(Lk,Bk,Rk), the boat set Bk is said to be bi-adjacent (or to satisfy bi-adjacency) if Bk is adjacent to both Lk and Rk.

By abuse of terminology, we say that the kth trip of S satisfies bi-adjacency if Bk is bi-adjacent.

Lemma 36.

Given a schedule S=(Lk,Bk,Rk)1kt of a tree T, there exists another schedule S¯=(L¯i,B¯i,R¯i)1it¯ of T with cost and demand at most C(S) and D(S), respectively, such that for each i, B¯i is bi-adjacent.

Proof.

Using Lemma 34, we get S^ of length t^ from the given schedule S. The cost and demand of S^ is not more than those of S, moreover, the boat set in each trip of S^ is uniformly adjacent.

Let be the first trip of S^ whose boat set (B^) is not bi-adjacent. The trips of S^ after index may also violate bi-adjacency. Hence, the total number of trips of S^ that violate this property is at most t^+1.

We construct a new schedule S¯ with the following properties:

  1. 1.

    S¯ is a legal schedule;

  2. 2.

    The cost and demand of S¯ is at most those of S^; and

  3. 3.

    The number of trips of S¯ that violates the bi-adjacency is at most t^.

We then apply the same procedure to the new schedule. Since at each step the upper bound on the number of trips violating bi-adjacency strictly decreases, and the schedule has finite length, the process terminates after finitely many steps.

We now construct the new schedule. Let be the first trip of S^ that violates bi-adjacency. The construction of S¯ is divided into multiple cases, depending on whether is even or odd and boat set is adjacent to the left bank or the right bank.

Case 1: is odd and all CCs of B^ are not adjacent to R^.

Let β1, β2,,βα denote the connected components of B^, where α1. Note that α cannot take the value 0, as otherwise th trip satisfy bi-adjacency. For pictorial representation of this case, refer to Figure 7. We further subdivide this case depending on what is dropped from the boat at the end of the th trip.

Figure 7: The th trip of S^ in Case 1.

Subcase 1a: R^+1R^.

In this case, since R^+1 has some elements of R^, it cannot have any element of B^, otherwise R^+1 would be disconnected. This means R^+1R^. Define a new schedule S¯ as:

(L¯i,B¯i,R¯i) =(L^i,B^i,R^i) for all i1 and i+2,
(L¯,B¯,R¯) =(L^B^,,R^),
(L¯+1,B¯+1,R¯+1) =(L¯,R^\R^+1,R^+1).

The schedule S¯ is vacuously legal and

B¯i B^i for all i1 and i+2,B¯B^,
B¯+1 B^(R^\R^+1)
=(B^R^)\R^+1 (as R^+1R^)
=B^+1.

Hence, the cost and demand of S¯ is at most those of S^. Additionally, th trip of S¯ satisfy bi-adjacency and therefore, the number of trips of S¯ that violates bi-adjacency is at most t^.

Subcase 1b: R^+1R^=.

In this case, either R^+1= or R^+1βi for exactly one i=1,2,,α as otherwise R^+1 would be disconnected. In the former case, R^+1=, define the new schedule as old schedule starting from +2th trip and it is easy to verify that the new schedule is legal, less costly and demanding than S^ and the number of trips in new schedule is t^. In the later case, R^+1βi for i=m (say), everything that was sent to the right bank before th trip is brought back in +1th trip, so to reduce the cost occurred in sending R^ is wasted. Hence, it would be better to start the schedule by sending just βm and then continue as per the further steps of the old schedule. So define the new schedule S¯ as:

(L¯1,B¯1,R¯1) =(V\βm,βm,),
(L¯2,B¯2,R¯2) =(L¯1,βm\R^+1,R^+1),
(L¯i,B¯i,R¯i) =(L^i+1,B^i+1,R^i+1) for all i3.

The schedule S¯ is vacuously legal and the cost and demand of S¯ as at most those of S^ as

B¯iB^i+1 for all i3,B¯1B^,
B¯2(B^\R^+1)R^=(B^R^)\R^+1=B^+1. (as R^+1B^)

The 1st trip of the S¯ satisfy bi-adjacency, hence the total number of trips of S¯ that violates bi-adjacency is at most t^.

Case 2: is even and all CCs of B are not adjacent to R^.

Since th trip is the first trip to violate bi-adjacency, (1)th trip satisfy bi-adjacency. This implies B^1R^1 is connected as R^1 is connected and B^1 is adjacent to R^1. Since, the schedule S^ is legal, and is even, B^R^=B^1R^1. This implies, all CCs of B^ must be adjacent to R^, which contradicts the assumption.

The omit the details of the two cases one, when is even and all CCs of B are not adjacent to L^ and other one, when is odd and all CCs of B are not adjacent to L^, as they are similar to Cases 1 and 2.

This completes the proof.

 Remark 37.

Lemma 36 also implies that there is at most one connected component on the boat in each trip of S¯.

In the next lemma, we show that given any optimal schedule, there exists another optimal schedule in which none of the vertices are ever transferred from the right bank to the left bank. To prove it, we use the following: In a schedule S of T, if all the vertices are transferred only once, C(S)=V(T) and vice-versa. This means, if C(S)>V(T), there is at least one trip from the right bank to the left bank, in which the boat is non-empty. We rectify the last such trip and reduce the cost by not increasing the demand. Doing this repetitively gives an optimal schedule with C(S)=V(T).

Lemma 38 (Empty Return Trips).

For any tree T, there exists an optimal schedule in which no vertices are transferred from the right bank to the left bank. That is, all return trips 𝖡2i are empty.

Proof.

Among the set of optimal schedules (the ones minimizes the boat size) of T, let S=(Lk,Bk,Rk)1kt be the one that minimizes the cost. Then by Lemma 36, there exists S¯=(S¯k,B¯k,R¯k)1kt¯ such that S¯ is optimal and C(S¯)C(S). If the boat in all the return trips of S¯ is empty, i.e., C(S¯)=|V(T)|, then we are done. Otherwise, assume i is the first return trip of S¯ in which the boat is non-empty, i.e., B¯k= for all even k<i and B¯i.

By Lemma 36, B¯i1 is adjacent to both L¯i1 and R¯i1 and B¯i is adjacent to both L¯i and R¯i.

If B¯i1B¯i=, all the vertices sent to right bank in i1th trip stayed on the right bank and a subset of vertices from R¯i1 were taken on the boat in the next trip, i.e., B¯iR¯i1. Since R¯i1 is not adjacent to L¯i1=L¯i (as otherwise it contradicts T being a tree), B¯i cannot be adjacent to L¯i, which is a contradiction. Hence, B¯i1B¯i. Let P=B¯i1B¯i, X=B¯i1\P and Y=B¯i\P. Then,

  1. 1.

    XY=;

  2. 2.

    XR¯i and YR¯i1 as XR¯i1=YR¯i.

We know B¯i=PY is adjacent to L¯i. If Y is adjacent to L¯i=L¯i1, then that implies R¯i1 is adjacent to L¯i1, which contradicts T being a tree. Hence P is adjacent to L¯i=L¯i1. Now consider the following schedule S=(Lk,Bk,Rk)1kt¯:

  1. 1.

    All the trips of S up to i2 are same as those of S¯,

  2. 2.

    Li1=L¯i1P,   Bi1=X,   Ri1=Ri1,

  3. 3.

    Li=Li1,   Bi=Y,   Ri=Ri, and

  4. 4.

    All trips of S from i+1 to t¯ is same as those of S¯.

Claim 39.

S is legal and C(S)<C(S¯) and D(S)D(S).

Proof.

To show that S is legal, we must show the following:

  1. 1.

    Li1=Li is connected,

  2. 2.

    Li1Bi1=L¯i1B¯i1,

  3. 3.

    Bi1Ri1=BiRi, and

  4. 4.

    LiBi=L¯iB¯i.

Starting with item (1), since P is adjacent to L¯i1, Li1 and Li are connected each.

For item (2), we know Li1Bi1=L¯i1PX=L¯i1B¯i1.

For item (3), we know Bi1Ri1=XRi1=YRi=BiRi.

For item (4), we know LiBi=L¯i1PY=L¯iB¯i.

The cost of S is strictly less than C(S¯) and D(S)D(S), vacuously. This completes the proof of the claim.

This implies S is an optimal schedule with lesser cost than S, which is a contradiction. Hence, the assumption about existence of i such that B¯i is non-empty is not true. This completes the proof.

Definition 40.

Let S=(Lk,Bk,Rk)1kt be a schedule. The weight sequence of the schedule, denoted by ω(S), is defined as the sequence ω(S):=(|Bi|)i=1 (with |Bj|=0 for j>t).

Lemma 41.

There exists an optimal schedule S=(Lk,Bk,Rk)1kt of a tree T that satisfies the following.

  1. 1.

    Bi is connected and there exists a vertex uiBi adjacent to both Li,Ri for all i[t].

  2. 2.

    There are no empty forward trips i.e., Bi for all odd i[t].

  3. 3.

    There are no non-empty backward trips i.e., Bi= for all even i[t].

Proof.

Let 𝒮 be the set of optimal schedules that have no non-empty backward trips and no empty forward trips such that it satisfies bi-adjacency. By Lemmas 36 and 38, we know that the set 𝒮 is non-empty. We define a ordering on the schedules of the set 𝒮 as follows: Define S1S2 if ω(S1)lexω(S2) where lex is the lexicographic ordering of positive integer sequences. We observe that the exclusion of non-empty backward trips and empty forward trips forces the sequences ω(S) for S𝒮 to be in 02n where n=|V(T)|. Since the lexicographic ordering on 02n is a well-ordering, we can find a lexicographically minimal ω(S0) for some S0𝒮.

We claim that S0=(Lk,Bk,Rk)1k2n is the required schedule. By contradiction, assume that S0 does not satisfy item (1) or S0 is not the required schedule, then there exists a smallest i such that Bi has ui adjacent to Ri and vi(ui) adjacent to Li. Let P be unique path on the tree T from ui to vi. Let C1,,Cr be the connected components formed when ui is deleted from Bi and adjust notation to let viC1. We could break the forward trip Bi into two smaller forward trips Bi:=uij=2rCj and Bi′′:=C1 while keeping the other trips the same. It is a legal schedule as vi and hence C1 is adjacent to Li and C2,,Cr are all adjacent to Ri in presence of ui. This new schedule lies in 𝒮 because it’s demand is no more than D(S0). Moreover, it’s weight sequence is lexicographically smaller than S0, which is a contradiction. This proves our claim.

 Remark 42.

Note that the optimal schedule with the lexicographically minimal weight sequence has to start its trip by ferrying a leaf vertex.

The following lemma follows directly from the definition of demand of a schedule.

Lemma 43.

Given a schedule S=(Lk,Bk,Rk)1kt of a tree T such that Bi= for even i[t], then

D(S)=max{D(S(Li)),|Bi|,D(S(Ri))},

where S(Ri)=(LkRi1,Bk,Rk)1k<i and S(Li)=(Lk,Bk,RkLi)i<kt and all i[t].

We describe a tree transfer algorithm that works greedily.

Algorithm 1 Greedy Tree Transfer Algorithm.

Given a tree T on n vertices and a designated starting leaf :

  1. 1.

    Initialize: Transfer the leaf to the right bank. Set b1.

  2. 2.

    Repeat until all vertices have been transferred:

    1. (a)

      Let v be the unique vertex on the left bank that has a neighbor already on the right bank.

    2. (b)

      Let c1,c2,,ck be the connected components of the left bank after removing v, ordered so that |c1||c2||ck|.

    3. (c)

      If k1: Transfer v alone (boat size 1 suffices for this trip).

    4. (d)

      If k2: Transfer v together with all vertices in c1,c2,,ck1. Update bmax(b, 1+i=1k1|ci|).

  3. 3.

    Return b as the boat size required for this choice of starting leaf .

Theorem 44 (Optimal Tree Transfer).

Let T be a tree. For each leaf of T, let b denote the boat size computed by the Tree Transfer Algorithm starting from . Then minb is the minimum boat size required to transfer T while maintaining connectivity on both banks, and the corresponding schedule is optimal.

Proof.

We prove that the optimal schedule S0 that satisfies the conditions of Lemma 41 has more demand than the greedy tree transfer algorithm. Let

S0=(Lk,Bk,Rk)1kt

where t2n as before and let Sg be the schedule that is obtained by applying the greedy algorithm starting from the leaf in B1 (see Remark 42). Let i[2n] such that Bi was not chosen greedily. Let ui be the vertex on Bi that is adjacent to both banks. Let us look at Li1. Since there are no backward trips, it contains the vertex ui. Let C1,,Cr be the components obtained when ui is deleted from Li1. Let C1 be the component with largest number of vertices and so, Sg would take uij=2rCj instead of uij=1r1Cj (WLOG, we let Cr be the one not taken by S0). We will show that D(S0)D(Sg) using Lemma 43.

To this end, we have to show that

max{D(S0(Li)),|uij=1r1Cj|,D(S0(Ri))}max{D(Sg(Li)),|uij=2rCj|,D(Sg(Ri))}.

We know that S0(Ri)=Sg(Ri) and therefore, D(S0(Ri))=D(Sg(Ri)) as they do not differ before trip i. Furthermore, we have that D(S0(Li))|Cr||C1|. Similarly, D(Sg(Li))|C1| and finally, |C1||uij=1r1Cj|. Therefore, the LHS of the inequality is either D(S0(Ri)) or |uij=1r1Cj|. If the LHS were equal to D(S0(Ri))=D(Sg(Ri)), then the inequality follows as D(S0(Ri))|uij=1r1Cj| and so, the RHS is D(Sg(Ri)). Similarly, if the LHS is |uij=1r1Cj|, then inequality holds as this term is larger than every term on the RHS.

Therefore, we have shown that if we apply the greedy algorithm starting from the same vertex as the schedule S0, we get a smaller demand than that of S0. Since S0 is optimal, it follows that the greedy algorithm is also optimal when starting from the appropriate vertex. If we were to apply the greedy algorithm from all possible leaves of the tree and find the minimum, we would an obtain an optimal schedule to ferry the tree under the given constraints.

6 Concluding Remarks

We have initiated the study of Ferry Cover problems under connectivity constraints, departing from the classical requirement that banks remain independent (stable) sets. Our main contributions are:

  1. 1.

    Hereditary properties. We showed that the structural characterization of Csorba, Hurkens, and Woeginger [1] extends to any hereditary graph property P: the boat size lies in {|Y|,|Y|+1} where Y is a minimum P-deletion set.

  2. 2.

    Boat-1 characterization. We completely characterized boat-1 graphs for the connected-bank variant: a connected graph is boat-1 if and only if its block-cut tree is a path. This yields a linear-time recognition algorithm.

  3. 3.

    Trees. We established that optimal schedules for trees need not have non-empty return trips, leading to an efficient algorithm for computing the minimum boat size.

We believe the connected-bank variant of Ferry Cover opens a rich landscape of combinatorial and algorithmic questions at the intersection of classical river-crossing puzzles and algorithmic and stuructural graph theory.

References

  • [1] Peter Csorba, Cor A. J. Hurkens, and Gerhard J. Woeginger. The alcuin number of a graph and its connections to the vertex cover number. SIAM Journal on Discrete Mathematics, 24(3):757–769, 2010. doi:10.1137/090759987.
  • [2] Hiro Ito, Stefan Langerman, and Yuichi Yoshida. Generalized river crossing problems. Theory of Computing Systems, 56(2):418–435, 2015. doi:10.1007/s00224-014-9557-1.
  • [3] Michael Lampis and Valia Mitsou. The ferry cover problem. In Fun with Algorithms, 4th International Conference, FUN 2007, volume 4475 of Lecture Notes in Computer Science, pages 227–239. Springer, 2007. doi:10.1007/978-3-540-72914-3_21.
  • [4] Abraham Lempel, Shimon Even, and Isaac Cederbaum. An algorithm for planarity testing of graphs. In Theory of Graphs: International Symposium, pages 215–232. Gordon and Breach, 1967.
  • [5] Abbas Seify and Hossein Shahmohamad. Some new results in the alcuin number of graphs. arXiv preprint arXiv:1409.6949, 2014.
  • [6] Erfang Shan and Liying Kang. The ferry cover problem on regular graphs and small-degree graphs. Chinese Annals of Mathematics, Series B, 39(6):933–946, 2018. doi:10.1007/s11401-018-0106-0.