CkPttn 1.2.5
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
NNPartMgr< Gnl, GainMgr, ConstrMgr > Class Template Reference

No-Nonsense Partitioning Algorithm Manager. More...

#include <NNPartMgr.hpp>

Inheritance diagram for NNPartMgr< Gnl, GainMgr, ConstrMgr >:
Inheritance graph
[legend]
Collaboration diagram for NNPartMgr< Gnl, GainMgr, ConstrMgr >:
Collaboration graph
[legend]

Public Member Functions

 NNPartMgr (const Gnl &hyprgraph, GainMgr &gain_mgr, ConstrMgr &constr_mgr, size_t num_parts)
 Constructs a new NNPartMgr object.
 
- Public Member Functions inherited from PartMgrBase< Gnl, GainMgr, ConstrMgr >
 PartMgrBase (const Gnl &hyprgraph, GainMgr &gain_mgr, ConstrMgr &constr_mgr, size_t num_parts)
 Construct a new Part Mgr Base object.
 
void init (std::span< std::uint8_t > part)
 Initializes the partition manager with the given partition.
 
auto legalize (std::span< std::uint8_t > part) -> LegalCheck
 Legalizes the partition to satisfy balance constraints.
 
void optimize (std::span< std::uint8_t > part)
 Optimizes the partition using the FM algorithm.
 

Protected Member Functions

void _optimize_1pass (std::span< std::uint8_t > part) override
 Performs a single pass of the No-Nonsense optimization algorithm.
 

Additional Inherited Members

- Public Types inherited from PartMgrBase< Gnl, GainMgr, ConstrMgr >
using GainCalc_ = typename GainMgr::GainCalc_
 
using GainMgr_ = GainMgr
 
using ConstrMgr_ = ConstrMgr
 
- Public Attributes inherited from PartMgrBase< Gnl, GainMgr, ConstrMgr >
int total_cost {}
 
- Protected Attributes inherited from PartMgrBase< Gnl, GainMgr, ConstrMgr >
const Gnl & hyprgraph
 Reference to the hypergraph being partitioned.
 
GainMgr & gain_mgr
 Gain manager for computing and managing gains.
 
ConstrMgr & validator
 Constraint manager for validating partition constraints.
 
size_t num_parts
 Number of partitions.
 

Detailed Description

template<typename Gnl, typename GainMgr, typename ConstrMgr>
class NNPartMgr< Gnl, GainMgr, ConstrMgr >

No-Nonsense Partitioning Algorithm Manager.

NNPartMgr reuses the shared FM algorithm skeleton from PartMgrBase (Template Method pattern: init/legalize/optimize) and overrides only the single-pass behaviour: unlike FM it is a pure greedy local search that stops at the first non-positive-gain move (no look-ahead / snapshot / rollback) and never locks a moved vertex. The gain-computation and constraint-validation strategies remain injected as template parameters.

Template Parameters
Gnl
GainMgr
ConstrMgr

Constructor & Destructor Documentation

◆ NNPartMgr()

template<typename Gnl , typename GainMgr , typename ConstrMgr >
NNPartMgr< Gnl, GainMgr, ConstrMgr >::NNPartMgr ( const Gnl &  hyprgraph,
GainMgr &  gain_mgr,
ConstrMgr &  constr_mgr,
size_t  num_parts 
)
inline

Constructs a new NNPartMgr object.

Parameters
[in]hyprgraphThe hypergraph to be partitioned
[in,out]gain_mgrThe gain manager used for the partitioning
[in,out]constr_mgrThe constraint manager used for the partitioning
[in]num_partsThe number of partitions to create

Member Function Documentation

◆ _optimize_1pass()

template<typename Gnl , typename GainMgr , typename ConstrMgr >
void NNPartMgr< Gnl, GainMgr, ConstrMgr >::_optimize_1pass ( std::span< std::uint8_t >  part)
overrideprotectedvirtual

Performs a single pass of the No-Nonsense optimization algorithm.

Pure greedy local search: repeatedly takes the highest-gain move from the gain buckets while its gain is strictly positive, and stops at the first non-positive-gain move. It performs no snapshotting/rollback and does not lock moved vertices.

Parameters
[in,out]partThe partition vector to optimize

Reimplemented from PartMgrBase< Gnl, GainMgr, ConstrMgr >.


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