---
title: Metro-Line Crossing Minimization (MLCM-P)
url: https://www.emergentmind.com/topics/metro-line-crossing-minimization-mlcm-p
type: topic
---

# Metro-Line Crossing Minimization (MLCM-P)

The Metro-Line Crossing Minimization Problem with Periphery constraint (MLCM-P) is a combinatorial optimization problem central to schematic network visualization, particularly the minimization of crossings among multiple simple paths ("lines") drawn atop a fixed embedded undirected graph representing stations and rail segments. Its distinguishing constraint—the periphery or terminal-at-verge condition—mandates that all line terminals must be attached at the outermost positions within each station rendering, reflecting longstanding practical conventions in metro map design. The problem has attracted significant attention due to its theoretical complexity, rigorous combinatorial structure, and utility as a benchmark for approximation, fixed-parameter, and exact algorithms in topological graph drawing.

## 1. Formal Definition and Periphery Constraint

Formally, let $G=(V,E)$ denote a planar embedded undirected graph, with vertices modeling stations and edges modeling rail-track segments. The input comprises a set $L$ of $m$ simple paths ("lines"), where each $\ell=(v_0, v_1, \ldots, v_d)\in L$ traverses a subset of $G$’s vertices in order, with ends $v_0$ and $v_d$. Each edge $(u,v)\in E$ is assigned a left-to-right ordering of the passing lines at each endpoint, subject to the following **periphery** constraint: if a line ends at $v$, its terminal must occupy one of the two outermost positions (topmost or bottommost) at the associated port in the station's representation. This prohibits such lines from being "sandwiched" between through-lines.

A **layout** that assigns such orderings gives rise to the notion of a **crossing**: two lines $\ell,\ell'$ cross on edge $(u,v)$ if their relative order differs at $u$ versus $v$. The **crossing number** $\mathrm{cr}(L)$ is the total number of such line-pair crossings across all edges. The **multiplicity** $k$ is defined as $k = \max_{(u,v) \in E} |\{\ell\in L: \ell \text{ passes through } (u,v)\}|$—the maximum number of lines sharing any edge.

The MLCM-P objective is: **Given $(G,L)$, find line orderings on all ports, respecting the periphery at terminals, that minimize $\mathrm{cr}(L)$.** Precise mathematical objective:
\[
\min_{\{\pi_{uv}\}} \sum_{(u,v)\in E}\sum_{\substack{\ell,\ell'\in L_{uv} \\
\pi_{uv}(\ell)<\pi_{uv}(\ell')\\ 
\pi_{vu}(\ell')<\pi_{vu}(\ell)}} 1
\]
where $\pi_{uv}$ is the ordering of $L_{uv}$ at port $(u \to v)$ [1306.2079][1306.3538].

## 2. Computational Hardness and Complexity Results

It is established that MLCM-P is NP-hard even when the underlying graph $G$ is a simple path. Specifically, Bekos et al. (2008) and Argyriou et al. (2009) proved that determining a minimum-crossing assignment of lines to path ports under the periphery constraint is NP-hard. The essential reduction encodes an NP-hard ordering problem as an instance where deviation from the intended ordering—forced by terminal placements—incurs a large crossing penalty, ensuring any optimal solution decodes a solution to the source instance. Furthermore, the unconstrained version (MLCM, without periphery) is shown NP-hard even on caterpillars via a "red cross" gadget construction [1306.2079].

The closely related decision problem, MLCM-P\_CROSSING (is $\min \mathrm{cr}(L)=0$?), however, admits a linear-time algorithm. This is achieved by reducing first to a "circle-inside-crossing" embedding problem and then further to recognizing planarity in an augmented graph $G''$. A crossing-free MLCM-P solution corresponds exactly to a planar embedding, which can be tested using Hopcroft–Tarjan planarity in $O(|V|+|E|+|L|)$ time [1306.3538].

## 3. Exact, Exponential-Time, and Fixed-Parameter Algorithms

The naive approach of enumerating all possible top/bottom assignments to each terminal yields $O^*(4^m)$ running time for exact minimization. This can be improved to $O^*(2^m)$ by branching only on the left-end assignments for each line, and making greedy optimum choices for the right ends. Pairs of lines are classified (patterns A, $C_\ell$, $C_r$, I, D) to determine which combinations can force crossings, and the case-analysis ensures global optimality for each partial assignment. Greedy sweeps over greedy right-end choices cost $O(m^2)$ per assignment [1306.3538].

Crucially, for parameter $k$ (maximum local line multiplicity), there exists an $O(k^3 2^k |V|)$ dynamic programming (DP) algorithm for paths. At each station, DP-tables $f_\ell(i,\pi)$ and $f_r(i,\rho)$ record the minimum crossing count for specified line permutations at the respective port sides. Efficient transition relies on (i) the periphery constraint, (ii) the property that "type C" line-pairs never cross in optimal solutions, and (iii) the fact that any first crossing between a pair $(\ell,\ell')$ occurs just before the maximal endpoint. Each step computes transitions using pairwise inversion counts in $O(k^3 2^k)$ per station, leading to the total complexity result [1306.3538]:
\[
O\left(k^3 2^k |V|\right)
\]
Thus, MLCM-P is fixed-parameter tractable (FPT) with respect to the local edge multiplicity $k$ on paths.

## 4. Approximation Algorithms and Reductions

An $O(\sqrt{\log |L|})$-approximation algorithm for MLCM-P leverages a reduction to the Min-2CNF-Deletion problem. For each line-terminal $x_{\ell,u}$ tracks the top/bottom placement at port $u$. Inter-line constraints for shared subpaths are captured as pairs of clauses in a 2CNF formula: each clause corresponds to a crossing constraint (e.g., "same side" or "opposite sides"), and each crossing in a final layout corresponds to a violated clause. The problem then reduces to deleting the smallest set of clauses to make the 2CNF instance satisfiable, for which an $O(\sqrt{\log m})$-approximation is available (Agarwal et al., 2005), with $m=O(|L|^2)$ being the number of clauses. The resulting layout incurs at most $O(\sqrt{\log |L|})$ times the optimal number of crossings and can be constructed in polynomial time [1306.2079].

The process involves:
1. Constructing the 2SAT instance in $O(|E|\cdot|L|^2)$ time.
2. Applying the approximation for clause deletion.
3. Solving the reduced 2SAT and recovering valid top/bottom assignments.
4. Ordering lines on edges by grouping all top-placed lines above bottoms.

## 5. Polynomial-Time Solvable Special Cases

Although MLCM-P is NP-hard in general, several restricted cases are solvable in polynomial or fixed-parameter time:
- **Zero-crossing existence:** Deciding whether a crossing-free solution exists for MLCM-P can be checked via the 2SAT reduction described above, discarding "unavoidable crossing" clauses, and solved in $O(|E|\,|L|^2)$ time [1306.2079].
- **Line direction-consistent graphs ("Proper variant"):** If all lines flow in the same direction across each edge (e.g., left-to-right paths or upward trees), a purely combinatorial $O(|L|^3)$-time algorithm is possible via a reduction to Min-Uncut in an "almost bipartite" auxiliary graph [1306.2079].
- **FPT by maximum parallel lines per edge ($k$):** Dynamic programming over all $O((k!)^2 |V|)$ port orderings gives an exact algorithm, applicable, for example, to paths and caterpillars [1306.2079].
- **FPT in number of crossings allowed ($k$):** Using the FPT algorithm for Min-2CNF-Deletion parameterized by $k$, with running time $O(15^k k m^3)$ where $m$ is the number of 2CNF clauses [1306.2079].

| Problem Variant                       | Complexity/Algorithm                 | Reference      |
|----------------------------------------|--------------------------------------|---------------|
| General MLCM-P                        | NP-hard, even for paths              | [1306.2079]   |
| MLCM-P, zero-crossing test             | $O(|E||L|^2)$ (2SAT)                 | [1306.2079]   |
| MLCM-P, FPT in $k$ (multiplicity)      | $O(k^3 2^k |V|)$ DP                  | [1306.3538]   |
| MLCM-P, FPT in number of crossings     | $O(15^k k m^3)$, parameter $k$       | [1306.2079]   |
| Proper-variant, direction-consistent   | $O(|L|^3)$ via Min-Uncut             | [1306.2079]   |
| Approximation ($O(\sqrt{\log |L|})$)   | Min-2CNF-Deletion reduction          | [1306.2079]   |

## 6. Open Problems and Future Directions

Several research directions for MLCM-P and related variants remain open:
- Determining whether the unconstrained MLCM problem admits any nontrivial approximation algorithm remains unresolved.
- Improving the $O(\sqrt{\log |L|})$ approximation factor for MLCM-P to a constant factor is an explicit open problem.
- Clarifying the complexity of MLCM-P and its "Proper" variant on general graphs, especially beyond path-like or direction-consistent cases.
- Extending practical variants to address not only crossing minimization but also other layout quality criteria, such as minimizing the number of polyline bends or optimally distributing crossings for readability.
- Development of FPT algorithms for MLCM-P on general networks parameterized by maximum local multiplicity or other structural parameters is a recognized avenue for further work [1306.2079][1306.3538].

These challenges underscore the central role of MLCM-P in both theoretical graph drawing and practical schematic network design.

Source: https://www.emergentmind.com/topics/metro-line-crossing-minimization-mlcm-p