elf
elf copied to clipboard
How do I view the source code for a specific algorithm in Multicut?
Hello, as an example, the specific function of multicut_kernighan_lin
, which I learned and tried to run in pycharm. I'd like to see the source code of its specific algorithm (intuition tells me it's probably a CPP source), but I can't get further into the source code by clicking on kernighanLinFactory
. Where can I find it?
def multicut_kernighan_lin(graph, costs, time_limit=None, warmstart=True, **kwargs):
""" Solve multicut problem with kernighan lin solver.
Introduced in "An efficient heuristic procedure for partitioning graphs":
http://xilinx.asia/_hdl/4/eda.ee.ucla.edu/EE201A-04Spring/kl.pdf
Arguments:
graph [nifty.graph] - graph of multicut problem
costs [np.ndarray] - edge costs of multicut problem
time_limit [float] - time limit for inference in seconds (default: None)
warmstart [bool] - whether to warmstart with gaec solution (default: True)
"""
objective = _to_objective(graph, costs)
solver = objective.kernighanLinFactory(warmStartGreedy=warmstart).create(objective)
visitor = _get_visitor(objective, time_limit, **kwargs)
return solver.optimize() if visitor is None else solver.optimize(visitor=visitor)
Also, the function multicut_kernighan_lin references 1970's An efficient heuristic procedure for partitioning graphs
, but in practice it defaults to initializing with a greedy strategy (warmStartGreedy= warmstart)
, so strictly speaking it is the KLj(Kernighan-Lin algorithm with Joins) algorithm with Joins proposed in "An efficient fusion move algorithm for the minimum cost lifted multicut problem"
of 2015 ICCV ?