Review of Serial and Parallel Min-Cut/Max-Flow
Algorithms for Computer Vision

IEEE Transactions on Pattern Analysis and Machine Intelligence, 2022

Patrick M. Jensen, Niels Jeppesen, Anders B. Dahl, Vedrana A. Dahl
Department of Applied Mathematics and Computer Science
Technical University of Denmark

Paper Code Data

Abstract

Minimum cut/maximum flow (min-cut/max-flow) algorithms solve a variety of problems in computer vision and thus significant effort has been put into developing fast min-cut/max-flow algorithms. As a result, it is difficult to choose an optimal algorithm for a given problem. Furthermore, parallel algorithms have not been thoroughly compared. In this paper, we evaluate the state-of-the-art serial and parallel min-cut/max-flow algorithms on the largest set of computer vision problems yet. We focus on generic algorithms , i.e., for unstructured graphs, but also compare with the specialized GridCut implementation. When applicable, GridCut performs best. Otherwise, the two pseudoflow algorithms, Hochbaum pseudoflow and excesses incremental breadth first search, achieves the overall best performance. The most memory efficient implementation tested is of the Boykov-Kolmogorov algorithm. Amongst generic parallel algorithms, we find the bottom-up merging approach by Liu and Sun to be best, but no method is dominant. Of the generic parallel methods, only the parallel preflow push-relabel algorithm is able to efficiently scale with many processors across problem sizes, and no generic parallel method consistently outperforms serial algorithms. Finally, we provide and evaluate strategies for algorithm selection to obtain good expected performance. We make our dataset and implementations publicly available for further research

Comparison of Serial Algorithms

We compare the main serial algorithms used in computer vision. We measure the relative performance (RP) w.r.t. the fastest algorithm for each min-cut/max-flow problem. Distributions close to one means an algorithm was often the fastest. EIBFS and HPF have the best performance.

Comparison on total times
Comparison on total times (init. + solve)
Comparison on solve times
Comparison on solve times

We also compare variations of each algorithm w.r.t. a reference (see paper for details) to show the effects of implementation details. Blue shows total time speed-up and red shows solve time speed-up.

Comparison on solve times
Comparison of BK variants
Comparison on total times
Comparison of EIBFS variants
Comparison on total times
Comparison of HPF variants

Comparison of Parallel Algorithms

We compare the state-of-the-art parallel algorithms for min-cut/max-flow in computer vision. We measure the speed-up on solve time w.r.t. the best serial algorithm for each min-cut/max-flow problem. All parallel algorithms have median speed-ups less than one.

Speed-up of parallel algorithms
Speed-up of parallel algorithms compared to best serial algorithm.

We also measure the speed-up of each algorithm w.r.t. their single threaded performance. Only P-PPR shows consistent improvements with more threads.

Speed-up of Liu-Sun
Speed-up of Liu-Sun

Speed-up of Strandmark-Kahl
Speed-up of Strandmark-Kahl
Speed-up of P-PPR
Speed-up of P-PPR

Speed-up of P-ARD
Speed-up of P-ARD

Algorithm Selection

We evalute different strategies for selecting a min-cut/max-flow algorithm depending on graph knowledge. Each strategy is evaluated on the mean relative performance (RP). A value of one means the strategy always selects the fastest algorithm.


Scenario 1: No Graph Knowledge: Here, we select the overall best algorithm. No generic algorithm dominates.
*Only counting grid graphs.

Serial algorithms

Algorithm Mean RP ± Std. RP Min RP Max RP
EIBFS-I0.59 ± 0.280.13091.00
EIBFS-I-NR0.56 ± 0.320.05351.00
EIBFS0.47 ± 0.230.12880.94
HI-PR0.16 ± 0.170.00461.00
HPF-H-F0.59 ± 0.330.02791.00
HPF-H-L0.64 ± 0.360.03931.00
HPF-L-F0.49 ± 0.290.03131.00
HPF-L-L0.53 ± 0.310.03121.00
MBK-R0.27 ± 0.200.00061.00
BK0.27 ± 0.240.00051.00
MBK0.28 ± 0.220.00051.00
GridCut*0.99 ± 0.030.64191.00

Parallel algorithms

Algorithm Mean RP ± Std. RP Min RP Max RP
Liu-Sun0.48 ± 0.300.06671.00
P-PPR0.46 ± 0.380.01331.00
Strandmark-Kahl0.23 ± 0.160.06670.85
P-ARD0.35 ± 0.320.00281.00
GridCut*1.00 ± 0.001.00001.00
Best serial0.59 ± 0.330.13651.00

Scenario 2: Known Problem Family: Here, we select the overall best algorithm for each problem family. This gives a high mean RP and for serial algorithms it is a near-optimal strategy.

Serial algorithms

Problem family Algorithm Mean RP
3D segmentation: SLG HPF-H-L0.81
Multi-view HPF-H-L1.00
Surface fitting GridCut1.00
3D segmentation: voxel-based GridCut0.98
Mesh segmentation EIBFS-I0.95
3D segmentation: sep. surfaces EIBFS-I0.92
3D MRF GridCut1.00
Deep LOGISMOS EIBFS-I-NR0.96
Deconvolution HPF-H-L0.96
DTF HPF-H-L1.00
Super resolution EIBFS-I0.87
Stereo 1 EIBFS-I0.99
Stereo 2 EIBFS-I1.00
ALE EIBFS-I-NR1.00
Graph matching: small HPF-L-L1.00
Graph matching: small EIBFS-I-NR0.91
Graph matching: small HPF-L-F1.00
Graph matching: small HPF-L-L1.00
Graph matching: small HPF-L-F1.00
Graph matching: big HPF-H1.00
Mean ± stdev.0.97 ± 0.05

Parallel algorithms

Problem family Algorithm Mean RP
3D segmentation: SLG Liu-Sun0.63
Multi-view Serial1.00
Surface fitting GridCut1.00
3D seg.: voxel-based (26-conn.)Serial0.86
3D seg.: voxel-based (6-conn.)GridCut1.00
Mesh segmentation P-ARD0.88
3D segmentation: sep. surfaces P-PPR0.74
3D MRF GridCut1.00
Mean ± stdev.0.89 ± 0.14

Scenario 3: Known Graph: Here, we train a simple decision tree to predict the best algorithm from summary graph statistics (see paper for details). This works well for serial algorithms but struggles for parallel algorithms.

Serial algorithms

Speed-up of parallel algorithms
Decision tree for serial algorithms. Mean RP: 0.82.

Parallel algorithms

Speed-up of parallel algorithms
Decision tree for parallel algorithms. Mean RP: 0.56.