Sub topic 3
Adapting the Borrowed Solution
This chapter assumes you can describe a problem in plain language, you have some problem-solving experience, and you can read basic Python. It also assumes you already have a mapping between a source domain and your target problem.
Adapting the borrowed solution
A mapping produces candidate claims about the target. Each borrowed step must then fit the target's constraints. A solution that works in the source may need a different scale, cost, or time limit in the target. For each borrowed step, ask three questions: What does this step need from the source? Does the target supply it? What must change so the target's limits hold?
Testing where the analogy holds and breaks
Mark each transferred relation as holds, breaks, or unknown. Check each mark against evidence from the target.
| Transferred relation | Status | Evidence |
|---|---|---|
| Higher temperature means more willingness to accept worse moves | Holds | Acceptance probability falls as temperature falls |
| Cooling rate controls how fast the search settles | Unknown | Needs a test on the target |
| Atoms settle into a lowest-energy state | Breaks | The search has no physical energy landscape |
An analogy is useful when the relations that matter most hold, and the broken ones are known and handled.
Pitfalls: surface bias and over-extended analogies
Surface bias means choosing a source because it looks like the target, such as sharing a keyword. An over-extended analogy keeps transferring relations after they stop matching. Watch for three signs: the source has a feature the target lacks, you explain away a failed test, or the borrowed solution needs a new exception each time.
Case studies: ideas that crossed fields
- Simulated annealing came from metallurgy and now searches large optimization problems.
- Ant colony optimization borrowed from how ants mark trails, and it is used to route vehicles and network traffic.
- Immune-system ideas inspired anomaly detection in computer security.
Worked example: simulated annealing
The mapping is simple. Temperature corresponds to willingness to accept worse moves, and cooling corresponds to reducing that willingness over time. The target has a fixed step budget, so the cooling rate must bring the temperature near zero before the steps run out.
import math
import random
def anneal(cost, neighbor, x, temp=1.0, cooling=0.995, steps=5000):
best = x
for _ in range(steps):
candidate = neighbor(x)
delta = cost(candidate) - cost(x)
if delta <= 0 or random.random() < math.exp(-delta / temp):
x = candidate
if cost(x) < cost(best):
best = x
temp *= cooling
return best
random.seed(1)
result = anneal(
cost=lambda x: (x - 3) ** 2,
neighbor=lambda x: x + random.uniform(-0.5, 0.5),
x=0.0,
)
print(round(result, 1))The program prints a value close to 3.0. With 5000 steps at 0.995 cooling, the temperature falls to about e^-25, which is effectively zero.
A routine you can repeat
- Describe the problem in abstract terms.
- Search at least two source domains that share its core relations.
- Write the mapping as a table of entities and relations.
- Adapt and test each borrowed step against target evidence.
- Keep the analogy if the key relations hold. Otherwise, return to step 2.
Exercise
Which situation shows surface bias?
Show answer
Choosing a source domain because it shares a keyword with the target, without checking whether its relations match.
Exercise
In the annealing example, what does the cooling rate control?
Show answer
How quickly the willingness to accept worse moves falls, which sets how fast the search settles.