Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Research](https://md.research.elamur.ai/free/en/) · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/) · [Shryfti](https://md.shryfti.elamur.ai/free/en/) · [OCR](https://md.ocr.elamur.ai/free/en/)

[Elamur Dictionary](https://md.dictionary.elamur.ai/free/en/) · [this page in HTML](https://dictionary.elamur.ai/free/en/english/dist/)

[dictionaries](https://md.dictionary.elamur.ai/free/en/) / [English](https://md.dictionary.elamur.ai/free/en/english/) / dist

# dist

English · noun

## Senses

### Sense 1 · noun · corpus

corpus

A code name that appears to stand for a distance value.

Source: Mova's open texts. Licence: cc-by-sa-4.0.

## Usage and labels

### corpus

In the Dijkstra code shown, dist\[v\] stores a distance for vertex v.

## Examples

3 source examples.

- 1 function Dijkstra(Graph, source): 2 3 for each vertex v in Graph.Vertices: 4 dist\[v\] ← INFINITY 5 prev\[v\] ← UNDEFINED 6 add v to Q 7 dist\[source\] ← 0 8 9 while Q is not empty: 10 u ← vertex in Q with minimum dist\[u\] 11 Q.remove(u) 12 13 for each edge (u, v) in Graph: 14 alt ← dist\[u\] + Graph.Distance(u,v) 15 if alt \< dist\[v\]: 16 dist\[v\] ← alt 17 prev\[v\] ← u 18 19 return dist\[\], prev\[\] — [Wikipedia: Dijkstra's algorithm](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm) (Wikipedia contributors). Licence: [cc-by-sa-4.0](https://creativecommons.org/licenses/by-sa/4.0/). — Mova's open texts (cc-by-sa-4.0)
- Instead of filling the priority queue with all nodes in the initialization phase, it is possible to initialize it to contain only source; then, inside the \*\*if\*\* \*alt\* \< dist\[\*v\*\] block, the becomes an operation. — [Wikipedia: Dijkstra's algorithm](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm) (Wikipedia contributors). Licence: [cc-by-sa-4.0](https://creativecommons.org/licenses/by-sa/4.0/). — Mova's open texts (cc-by-sa-4.0)
- Yet another alternative is to add nodes unconditionally to the priority queue and to instead check after extraction (\*u\* ← \*Q\*.extract\_min) that it isn't revisiting, or that no shorter connection was found yet in the if alt \< dist\[v\] block. — [Wikipedia: Dijkstra's algorithm](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm) (Wikipedia contributors). Licence: [cc-by-sa-4.0](https://creativecommons.org/licenses/by-sa/4.0/). — Mova's open texts (cc-by-sa-4.0)

## Notes and derived forms

### corpus

## Sources

Mova's open texts. Licence: cc-by-sa-4.0.

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://dictionary.elamur.ai/sitemap.xml) · [llms.txt](https://dictionary.elamur.ai/llms.txt)
