Ferry Cover with Connectivity Constraints
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, connectivityCopyright and License:
2012 ACM Subject Classification:
Theory of computation Graph algorithms analysis ; Mathematics of computing Graph theoryAcknowledgements:
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 IaconoSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
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 (excluding the sailor’s seat) for a given graph that allows all vertices of to be transferred from one bank to the other without ever leaving an edge of on a bank. They called it the Ferry Cover (FC) problem and established the following tight relation between the ferry cover number and the vertex cover number :
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 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 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 is connected, and we say that is boat- if is the minimum boat size sufficient to transfer all vertices of 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 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 relating the Alcuin number to the vertex cover number , and proving NP-hardness and APX-hardness. This dichotomy partitions graphs into class 1 (small-boat, where ) and class 2 (large-boat, where ).
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 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: is class 2 if and only if for every pair of independent sets , the union 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 are class 2 for but class 1 for , 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 by replacing the vertex cover with a minimum -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 , 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 be a graph and let . The induced subgraph of on is a graph with vertex set and edge set consisting of all edges of with both endpoints in . It is denoted by , or .
Throughout the paper, we do not distinguish between a vertex set and the subgraph of induced by , and use to denote both when the meaning is clear from the context.
Definition 2 (Hereditary Property).
A graph property is hereditary if every induced subgraph of a graph satisfying satisfies .
For example, the property of not containing cycle is a hereditary property because if a graph does not contain any cycle, then any induced subgraph of 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 .
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 of a graph is called a cut-vertex if removal of increases the number of connected components of .
Observation 6.
Two blocks of a graph cannot have more than 1 vertex in common.
Definition 7 (Small-Boat).
A graph is called small-boat if the boat size required to transfer all vertices of 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 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 can be transferred across the river with boat of size if and only if there exists five subsets and of such that:
-
1.
and is a partition of a stable set in ,
-
2.
and are non-empty subsets of the set , which satisfies ,
-
3.
and are stable sets in , and
-
4.
.
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 on the banks is hereditary, we can use the same theorem with being the subset to be removed so that satisfies . 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 , where and are the vertices on the left bank, boat and the right bank, respectively, during transfer.
Definition 9 (Feasible Schedule with respect to ).
Given a graph , boat size and a hereditary graph property , a feasible schedule is a schedule such that
-
1.
For any , and is a partition of such that both and satisfy and ;
-
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 and ;
-
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 , and , and for odd , and .
Example 10 (Transferring a 4-cycle with boat size 2).
Consider the cycle on vertices with edges . The two diagonal pairs and are independent sets. With a boat of capacity , 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 denote the minimum boat size required to transfer when the required property on the banks is a hereditary property . Let be a smallest subset of such that the induced subgraph satisfies . Then
Proof.
For the lower bound, observe that during the first trip, the sailor must take at least vertices so that the induced subgraph on the remaining vertices satisfies . Thus .
For the upper bound, we exhibit a feasible schedule using a boat of size . The sailor keeps 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 . Since satisfies and is hereditary, every induced subgraph of also satisfies . Hence .
Definition 12 (Small-Boat and Large-Boat with respect to ).
Let be a hereditary property and let be a graph. Let be a smallest subset of such that satisfies . We say is small-boat with respect to if all vertices can be transferred with a boat of size ; otherwise, is large-boat with respect to .
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 be a hereditary property. A graph can be transferred across the river with a boat of size , maintaining property on both banks throughout, if and only if there exist subsets such that:
-
1.
partition a set where satisfies ;
-
2.
and are non-empty subsets of with ;
-
3.
and both satisfy ; and
-
4.
.
Proof.
We prove both directions separately.
() Sufficiency.
Suppose subsets satisfying conditions (1)–(4) exist. We construct a feasible schedule, illustrated in Figure 2. We use the notation to denote a snapshot where , , and are the vertices on the left bank, boat, and right bank, respectively.
-
1.
Initial transport of : Load onto the boat and deposit on the right bank, then return. This yields . This is valid since , and both and induce subgraphs satisfying (by conditions (1) and (3), using heredity).
-
2.
Transfer : Since , there is at least one free seat. Transfer elements of one by one from left to right, reaching . Throughout, the left bank contains subsets of and the right bank contains subsets of , both satisfying by heredity.
-
3.
Exchange via : Partition into and with and (possible by condition (4)). Execute four crossings:
At each step, both banks contain subsets of sets satisfying , and the boat carries at most vertices.
-
4.
Transfer : Since , transfer elements of one by one, reaching .
-
5.
Final transport: Load and deposit everyone on the right bank.
() Necessity.
Given a feasible schedule , we construct the required subsets. We may assume for all , since consecutive identical boat contents indicate redundant trips.
Let be a smallest subset such that satisfies . By Observation 11, . Let be any superset of with , and set . Then satisfies . We consider three cases.
Case 1: There exists with and .
Set , , , , and . Then partition , satisfying (1). Both and are non-empty subsets of , satisfying (2). Since and must satisfy (as they are bank contents), condition (3) holds. For (4):
giving .
Case 2: There exists with .
Suppose is even (the odd case is symmetric). Since , some vertices of were on the right bank during trip ; set . Similarly, implies .
Every vertex of lies in exactly one of or . Define , , , , and . Conditions (1)–(3) follow from the feasibility of the schedule. Since the sailor dropped and picked up (filling the boat), we have ; similarly , yielding (4).
Case 3: Neither Case 1 nor Case 2 holds.
Here, for all , either or , and for . Since (initially all vertices are on the left) and (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 , since disconnected graphs trivially fail the connectivity requirement.
Definition 14 (Boat- Graph).
A connected graph is boat- if is the minimum boat size sufficient to transfer all vertices of 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 is boat-, then any graph with is boat- for some .
Proof.
Since contains all edges of , any subset of vertices inducing a connected subgraph in also induces a connected subgraph in . Thus, any valid transfer schedule for remains valid for .
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 has a Hamiltonian path, then 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 .
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 be a graph with . An st-numbering of is a bijection such that for every vertex with , there exist neighbors and of with .
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 be a biconnected graph and let be any edge. Then admits an st-numbering in which receives number and receives number .
The connection to our problem is immediate: an st-numbering provides a transfer order that maintains connectivity.
Lemma 20.
If admits an st-numbering , then for all :
-
1.
the subgraph induced by is connected; and
-
2.
the subgraph induced by is connected.
Proof.
We prove (1) by induction on . For , the subgraph contains a single vertex and is trivially connected. Assume the subgraph induced by vertices numbered through is connected. The vertex with has a neighbor with (unless , in which case is the last vertex and has a neighbor with smaller number by the st-numbering property). Thus, is adjacent to the connected subgraph on vertices through , so the subgraph on through is connected.
The proof of (2) is symmetric, proceeding by downward induction from .
Lemma 21.
If a graph admits an st-numbering, then it is boat-1.
Proof.
Let be an st-numbering of . Transfer vertices in the order . After transferring the vertex numbered , the left bank contains vertices numbered through , and the right bank contains vertices numbered through . By Lemma 20, both subgraphs are connected.
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 .
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 is the bipartite graph whose vertices are the blocks and cut-vertices of , with an edge between a block and a cut-vertex if and only if .
The block-cut tree is indeed a tree (hence the name) and captures how the blocks of 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 is not boat-1 if either:
-
1.
some block of contains three or more cut-vertices of ; or
-
2.
some cut-vertex of belongs to three or more blocks of .
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 by . Consider any transfer schedule and let be a cut-vertex in that is neither the first nor the last among to be transferred. Such a vertex exists since . At the moment is transferred, some cut-vertices from are on the left bank and some are on the right bank.
Since is a cut-vertex, removal of divides into 2 components, say and . The block is contained either in or in but not both, because is a block. So, without loss of generality, assume that is contained in . This implies is a subset of vertices of and therefore, during the transfer of , some vertices of are on the left bank and some on the right bank. Consider the following cases depending upon the time when is transferred:
-
1.
is transferred before transferring : Just after the transfer of , and a part of are on the left bank and the two cannot be connected in the absence of because it contradicts being the cut-vertex.
-
2.
is transferred after transferring partially or fully: just before the transfer of , a part of and are on the right bank and the two cannot be connected in the absence of because it contradicts 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 is transferred. By Observation 6, the blocks are pairwise vertex-disjoint except at . Thus, at the moment is transferred:
-
If is transferred before completely transferring at least two blocks, then after leaves the left bank, at least two blocks (minus ) remain, and they are disconnected.
-
If is transferred after parts of at least two blocks have reached the right bank, then before arrives, those partial blocks are disconnected on the right bank.
In either case, connectivity fails without transferring additional vertices alongside .
Theorem 26.
If the block-cut tree of a connected graph is not a path, then is not boat-1.
Proof.
The block-cut tree is bipartite with blocks on one side and cut-vertices on the other. If is not a path, then some vertex of 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, 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 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 admits an st-numbering, from which boat-1 follows by Lemma 21. Let be the block-cut tree of . If is biconnected, then consists of a single block, which is trivially a path, and is boat-1 by Corollary 22. Assume has at least two blocks. We first establish:
Claim 28.
The endpoints of are blocks, not cut-vertices.
Proof of Claim.
Suppose an endpoint of is a cut-vertex . Then has degree 1 in , meaning belongs to exactly one block . But then removing from cannot disconnect (since all of remains within the components attached to ), contradicting that is a cut-vertex.
Thus has the structure shown in Figure 5: blocks connected by cut-vertices , where is the unique vertex shared by and .
We construct an st-numbering of by combining st-numberings of the individual blocks.
Claim 29.
admits an st-numbering.
Proof of Claim.
For each block , we construct an st-numbering with specified endpoints:
-
For : Choose any neighbor of in . Since is biconnected, by Theorem 19 there exists an st-numbering of with numbered and numbered .
-
For with : We need numbered first and numbered last. If , apply Theorem 19 directly. Otherwise, temporarily add the edge to , obtain an st-numbering, then remove the edge. The st-numbering property is preserved since we only required and to be endpoints.
-
For : Choose any neighbor of in . Obtain an st-numbering with numbered and numbered .
Now combine these numberings. Let for each . For vertices in , keep their numbers. For vertices in with , add to each number. This offset accounts for the fact that each cut-vertex is numbered last in and first in , receiving number in the combined numbering.
The resulting numbering is an st-numbering of : 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, 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 be a schedule for a graph . The demand, denoted by is defined as . The cost, denoted by , is defined as .
We will use (resp. ) instead of (resp. ) whenever 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 of , the cost is the same as . 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 and of a graph are said to be adjacent if the graph induced by is connected.
Equivalently, and are adjacent if there exists an edge of between a vertex of and a vertex of . By abuse of language, we sometimes say is adjacent to and vice-versa. By convention, we declare that the empty graph is adjacent to any connected graph, and vice versa.
Let be a schedule of a tree . For any index , each CC of is adjacent to , or to , or to both. When no confusion arises, we use the same symbol to denote a vertex subset and the subgraph induced by it.
Let denote the union of vertices of all CCs of that are adjacent to , and let denote the union of vertices of all CCs of that are adjacent to . Since is acyclic, there can be at most one CC of that is adjacent to both and ; denote this component by . Moreover, if , then and are adjacent, as is connected. This can be visualized in Figure 6.
Definition 33 (Uniformly adjacent).
Given a schedule of a graph, the connected components of are said to be uniformly adjacent: if either all are adjacent to , or all are adjacent to , or all are adjacent to both and .
Given a schedule, if the CCs of are not uniformly adjacent, by abuse of language, we say that the trip violates the uniform adjacency property. For brevity, we may also say that is not uniformly adjacent, instead of explicitly referring to its connected components.
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 of a tree , there exists another schedule of with demand and cost at most and , respectively, such that for each , the connected components of are uniformly adjacent.
In Lemma 34, we showed that for any schedule , there exists a schedule with cost and demand no greater than those of , such that in every trip of , the boat set is uniformly adjacent. The next lemma strengthens this result. It shows that, starting from , we can construct another schedule , again without increasing the cost or demand, such that in each trip of , the boat contains at most one connected component that is adjacent to both banks. Moreover, the boat set of every even-indexed trip in 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 , the boat set is said to be bi-adjacent (or to satisfy bi-adjacency) if is adjacent to both and .
By abuse of terminology, we say that the trip of satisfies bi-adjacency if is bi-adjacent.
Lemma 36.
Given a schedule of a tree , there exists another schedule of with cost and demand at most and , respectively, such that for each , is bi-adjacent.
Proof.
Using Lemma 34, we get of length from the given schedule . The cost and demand of is not more than those of , moreover, the boat set in each trip of is uniformly adjacent.
Let be the first trip of whose boat set () is not bi-adjacent. The trips of after index may also violate bi-adjacency. Hence, the total number of trips of that violate this property is at most .
We construct a new schedule with the following properties:
-
1.
is a legal schedule;
-
2.
The cost and demand of is at most those of ; and
-
3.
The number of trips of that violates the bi-adjacency is at most .
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 that violates bi-adjacency. The construction of 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 are not adjacent to
Let , denote the connected components of , where . Note that cannot take the value 0, as otherwise 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 trip.
Subcase 1a:
In this case, since has some elements of , it cannot have any element of , otherwise would be disconnected. This means . Define a new schedule as:
The schedule is vacuously legal and
| (as ) | ||||
Hence, the cost and demand of is at most those of . Additionally, trip of satisfy bi-adjacency and therefore, the number of trips of that violates bi-adjacency is at most .
Subcase 1b:
In this case, either or for exactly one as otherwise would be disconnected. In the former case, , define the new schedule as old schedule starting from trip and it is easy to verify that the new schedule is legal, less costly and demanding than and the number of trips in new schedule is . In the later case, for (say), everything that was sent to the right bank before trip is brought back in trip, so to reduce the cost occurred in sending is wasted. Hence, it would be better to start the schedule by sending just and then continue as per the further steps of the old schedule. So define the new schedule as:
The schedule is vacuously legal and the cost and demand of as at most those of as
| (as ) |
The trip of the satisfy bi-adjacency, hence the total number of trips of that violates bi-adjacency is at most .
Case 2: is even and all CCs of are not adjacent to
Since trip is the first trip to violate bi-adjacency, trip satisfy bi-adjacency. This implies is connected as is connected and is adjacent to . Since, the schedule is legal, and is even, . This implies, all CCs of must be adjacent to , which contradicts the assumption.
The omit the details of the two cases one, when is even and all CCs of are not adjacent to and other one, when is odd and all CCs of are not adjacent to , 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 .
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 of , if all the vertices are transferred only once, and vice-versa. This means, if , 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 .
Lemma 38 (Empty Return Trips).
For any tree , there exists an optimal schedule in which no vertices are transferred from the right bank to the left bank. That is, all return trips are empty.
Proof.
Among the set of optimal schedules (the ones minimizes the boat size) of , let be the one that minimizes the cost. Then by Lemma 36, there exists such that is optimal and . If the boat in all the return trips of is empty, i.e., , then we are done. Otherwise, assume is the first return trip of in which the boat is non-empty, i.e., for all even and .
By Lemma 36, is adjacent to both and and is adjacent to both and .
If , all the vertices sent to right bank in trip stayed on the right bank and a subset of vertices from were taken on the boat in the next trip, i.e., . Since is not adjacent to (as otherwise it contradicts being a tree), cannot be adjacent to , which is a contradiction. Hence, . Let , and . Then,
-
1.
-
2.
and as .
We know is adjacent to . If is adjacent to , then that implies is adjacent to , which contradicts being a tree. Hence is adjacent to . Now consider the following schedule :
-
1.
All the trips of up to are same as those of ,
-
2.
, , ,
-
3.
, , , and
-
4.
All trips of from to is same as those of .
Claim 39.
is legal and and .
Proof.
To show that is legal, we must show the following:
-
1.
is connected,
-
2.
,
-
3.
, and
-
4.
.
Starting with item (1), since is adjacent to , and are connected each.
For item (2), we know .
For item (3), we know .
For item (4), we know .
The cost of is strictly less than and , vacuously. This completes the proof of the claim.
This implies is an optimal schedule with lesser cost than , which is a contradiction. Hence, the assumption about existence of such that is non-empty is not true. This completes the proof.
Definition 40.
Let be a schedule. The weight sequence of the schedule, denoted by , is defined as the sequence (with for ).
Lemma 41.
There exists an optimal schedule of a tree that satisfies the following.
-
1.
is connected and there exists a vertex adjacent to both for all .
-
2.
There are no empty forward trips i.e., for all odd .
-
3.
There are no non-empty backward trips i.e., for all even .
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 if where 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 for to be in where . Since the lexicographic ordering on is a well-ordering, we can find a lexicographically minimal for some .
We claim that is the required schedule. By contradiction, assume that does not satisfy item (1) or is not the required schedule, then there exists a smallest such that has adjacent to and adjacent to . Let be unique path on the tree from to . Let be the connected components formed when is deleted from and adjust notation to let . We could break the forward trip into two smaller forward trips and while keeping the other trips the same. It is a legal schedule as and hence is adjacent to and are all adjacent to in presence of . This new schedule lies in because it’s demand is no more than . Moreover, it’s weight sequence is lexicographically smaller than , 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 of a tree such that for even , then
where and and all .
We describe a tree transfer algorithm that works greedily.
Given a tree on vertices and a designated starting leaf :
-
1.
Initialize: Transfer the leaf to the right bank. Set .
-
2.
Repeat until all vertices have been transferred:
-
(a)
Let be the unique vertex on the left bank that has a neighbor already on the right bank.
-
(b)
Let be the connected components of the left bank after removing , ordered so that .
-
(c)
If : Transfer alone (boat size 1 suffices for this trip).
-
(d)
If : Transfer together with all vertices in . Update .
-
(a)
-
3.
Return as the boat size required for this choice of starting leaf .
Theorem 44 (Optimal Tree Transfer).
Let be a tree. For each leaf of , let denote the boat size computed by the Tree Transfer Algorithm starting from . Then is the minimum boat size required to transfer while maintaining connectivity on both banks, and the corresponding schedule is optimal.
Proof.
We prove that the optimal schedule that satisfies the conditions of Lemma 41 has more demand than the greedy tree transfer algorithm. Let
where as before and let be the schedule that is obtained by applying the greedy algorithm starting from the leaf in (see Remark 42). Let such that was not chosen greedily. Let be the vertex on that is adjacent to both banks. Let us look at . Since there are no backward trips, it contains the vertex . Let be the components obtained when is deleted from . Let be the component with largest number of vertices and so, would take instead of (WLOG, we let be the one not taken by ). We will show that using Lemma 43.
To this end, we have to show that
We know that and therefore, as they do not differ before trip . Furthermore, we have that . Similarly, and finally, . Therefore, the LHS of the inequality is either or . If the LHS were equal to , then the inequality follows as and so, the RHS is . Similarly, if the LHS is , 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 , we get a smaller demand than that of . Since 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.
Hereditary properties. We showed that the structural characterization of Csorba, Hurkens, and Woeginger [1] extends to any hereditary graph property : the boat size lies in where is a minimum -deletion set.
-
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.
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.
