1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
/* ========================================================================== */
/* === Include/Mongoose_ImproveFM.hpp ======================================= */
/* ========================================================================== */
/* -----------------------------------------------------------------------------
* Mongoose Graph Partitioning Library, Copyright (C) 2017-2023,
* Scott P. Kolodziej, Nuri S. Yeralan, Timothy A. Davis, William W. Hager
* Mongoose is licensed under Version 3 of the GNU General Public License.
* Mongoose is also available under other licenses; contact authors for details.
* SPDX-License-Identifier: GPL-3.0-only
* -------------------------------------------------------------------------- */
// #pragma once
#ifndef MONGOOSE_IMPROVEFM_HPP
#define MONGOOSE_IMPROVEFM_HPP
#include "Mongoose_CutCost.hpp"
#include "Mongoose_EdgeCutOptions.hpp"
#include "Mongoose_EdgeCutProblem.hpp"
#include "Mongoose_Internal.hpp"
namespace Mongoose
{
/* Swap candidates have the following features: */
struct SwapCandidate
{
Int vertex;
bool partition;
double vertexWeight;
double gain;
double heuCost;
Int bhPosition;
double imbalance;
SwapCandidate()
{
vertex = 0;
partition = false;
vertexWeight = 0.0;
gain = -INFINITY;
heuCost = INFINITY;
bhPosition = -1;
imbalance = 0.0;
}
};
void improveCutUsingFM(EdgeCutProblem *, const EdgeCut_Options *);
void fmSwap(EdgeCutProblem *, const EdgeCut_Options *, Int vertex, double gain,
bool oldPartition);
void fmRefine_worker(EdgeCutProblem *graph, const EdgeCut_Options *options);
void calculateGain(EdgeCutProblem *, const EdgeCut_Options *, Int vertex, double *out_gain,
Int *out_externalDegree);
} // end namespace Mongoose
#endif
|