liveBook · Manning

Heuristic desirability

As explained in Algorithms Every Programmer Should Know

A measure of a path's desirability in ant colony optimization, calculated here as the inverse of its distance.

In ant colony optimization, heuristic desirability favors shorter paths: calculate it as 1 divided by the path’s distance. It combines with pheromone levels to influence an ant’s next move. section 8.1

Compare path distances

For distances of 10, 15, and 20, desirability scores are 0.10, 0.067, and 0.05. With equal pheromone levels, the shorter path has the higher raw score. section 8.1

How Algorithms Every Programmer Should Know covers it

How deep it goes
Defines desirability as inverse distance and works through sample scores, stopping short of a deeper derivation.
Examples
Compares paths of 10, 15, and 20 distance units, with desirability scores of 0.10, 0.067, and 0.05.
What you can do after
Evaluate how inverse distance contributes to an ant’s relative path choices.
How it connects
Connects ant colony optimization, pheromone levels, and probability-based path selection.

This explainer was generated by Manning's knowledge graph from the text of Algorithms Every Programmer Should Know. The section links point to the parts of the book it draws on.