ArticleslgStudy

computer science

Lin–Kernighan heuristic

Lin–Kernighan heuristic is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Lin–Kernighan heuristic rather than just read about it. In short: In combinatorial optimization, Lin–Kernighan is one of the best heuristics for solving the symmetric travelling salesman problem. It belongs to the class of local search algorithms, which take a tour (Hamiltonian cycle) as part of the input and attempt to improve it by searching in the neighbourhood of the given tour for one that is shorter, and upon finding one repeats the process from that new one, until encounter…

Key takeaways

  • Lin–Kernighan heuristic belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Lin–Kernighan heuristic to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Lin–Kernighan heuristic from memory before moving on to harder problems.

Reference excerpt

In combinatorial optimization, Lin–Kernighan is one of the best heuristics for solving the symmetric travelling salesman problem. It belongs to the class of local search algorithms, which take a tour (Hamiltonian cycle) as part of the input and attempt to improve it by searching in the neighbourhood of the given tour for one that is shorter, and upon finding one repeats the process from that new one, until encountering a local minimum. As in the case of the related 2-opt and 3-opt algorithms, the relevant measure of "distance" between two tours is the number of edges which are in one but not the other; new tours are built by reassembling pieces of the old tour in a different order, sometimes changing the direction in which a sub-tour is traversed. Lin–Kernighan is adaptive and has no fixed number of edges to replace at a step, but favours small numbers such as 2 or 3.

Derivation For a given instance ( G , c ) {\displaystyle (G,c)} of the travelling salesman problem, tours are uniquely determined by their sets of edges, so we may as well encode them as such. In the main loop of the local search, we have a current tour T ⊂ E ( G ) {\displaystyle T\subset \mathrm {E} (G)} and are looking for new tour T ′ ⊂ E ( G ) {\displaystyle T'\subset \mathrm {E} (G)} such that the symmetric difference F = T △ T ′ {\displaystyle F=T\mathbin {\triangle } T'} is not too large and the length ∑ e ∈ T ′ c ( e ) {\displaystyle \sum _{e\in T'}c(e)} of the new tour is less than the length ∑ e ∈ T c ( e ) {\displaystyle \sum _{e\in T}c(e)} of the current tour. Since F {\displaystyle F} is typically much smaller than T {\displaystyle T} and T ′ {\displaystyle T'} , it is convenient to consider the quantity

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Lin–Kernighan heuristic

Start with the simplest possible case. Write down what Lin–Kernighan heuristic claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Lin–Kernighan heuristic before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Lin–Kernighan heuristic ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Lin–Kernighan heuristic

In research
Lin–Kernighan heuristic appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Lin–Kernighan heuristic in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Lin–Kernighan heuristic is common in secondary-school and first-year university syllabi. It links to neighbouring topics Combinatorial algorithms, Combinatorial optimization, Heuristic algorithms, so understanding it makes those chapters shorter.
In everyday life
Look for Lin–Kernighan heuristic outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Lin–Kernighan heuristic” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Lin–Kernighan heuristic in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Lin–Kernighan heuristic means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Lin–Kernighan heuristic out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Lin–Kernighan heuristic in simple terms?

In combinatorial optimization, Lin–Kernighan is one of the best heuristics for solving the symmetric travelling salesman problem. It belongs to the class of local search algorithms, which take a tour (Hamiltonian cycle) as part of the input and attempt to improve it by searching in the neighbourhoo…

Why does Lin–Kernighan heuristic matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Lin–Kernighan heuristic?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Lin–Kernighan heuristic.

Tags

  • Combinatorial algorithms
  • Combinatorial optimization
  • Heuristic algorithms
  • Travelling salesman problem

Keep exploring