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
GreedyStrategy< T > Class Template Reference

Expansion strategy that always picks the label with the greatest energy reduction. More...

#include <GreedyStrategy.hpp>

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

Public Member Functions

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

Detailed Description

template<typename T>
class GreedyStrategy< T >

Expansion strategy that always picks the label with the greatest energy reduction.

Each cycle evaluates all labels and applies only the expansion move that yields the largest energy decrease. This is more expensive per cycle than SequentialStrategy (O(K) max-flow solves per cycle instead of one) but may converge in fewer cycles on some instances.

Template Parameters
TNumeric cost type.

Constructor & Destructor Documentation

◆ GreedyStrategy()

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

Constructs the strategy.

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

Member Function Documentation

◆ execute()

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

Runs greedy 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: