Alpha Expansion Library
C++ library for the Alpha-Expansion graph-cut algorithm with Python bindings
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SequentialStrategy< T > Class Template Reference

Expansion strategy that cycles through labels in fixed order 0, 1, …, K-1. More...

#include <SequentialStrategy.hpp>

Inheritance diagram for SequentialStrategy< T >:
[legend]
Collaboration diagram for SequentialStrategy< T >:
[legend]

Public Member Functions

 SequentialStrategy (int max_cycles=100)
 Constructs the strategy.
 
int execute (AlphaExpansion< T > &optimizer, EnergyModel< T > &model) const override
 Runs sequential alpha-expansion until convergence or max_cycles.
 
- Public Member Functions inherited from ExpansionStrategy< T >
virtual ~ExpansionStrategy ()=default
 

Detailed Description

template<typename T>
class SequentialStrategy< T >

Expansion strategy that cycles through labels in fixed order 0, 1, …, K-1.

Each cycle tries one expansion move per label. The strategy converges when a full cycle produces no change in any label, or when max_cycles is reached. This is the standard strategy from the original Boykov–Veksler–Zabih paper.

Template Parameters
TNumeric cost type.

Constructor & Destructor Documentation

◆ SequentialStrategy()

template<typename T >
SequentialStrategy< T >::SequentialStrategy ( int  max_cycles = 100)
inline

Constructs the strategy.

Parameters
max_cyclesMaximum number of full label cycles before stopping (default: 100).

Member Function Documentation

◆ execute()

template<typename T >
int SequentialStrategy< T >::execute ( AlphaExpansion< T > &  optimizer,
EnergyModel< T > &  model 
) const
inlineoverridevirtual

Runs sequential alpha-expansion until convergence or max_cycles.

Returns
Number of full cycles completed.

Implements ExpansionStrategy< T >.


The documentation for this class was generated from the following file: