mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-03 22:43:35 +00:00
26 lines
633 B
Plaintext
26 lines
633 B
Plaintext
---
|
|
syntax: markdown
|
|
tags: [tldr, common]
|
|
source: https://github.com/tldr-pages/tldr.git
|
|
---
|
|
# dijkstra
|
|
|
|
> Compute shortest-path distances from a single source node in a graph.
|
|
> More information: <https://graphviz.org/pdf/dijkstra.1.pdf>.
|
|
|
|
- Compute distances from a given source node in a graph file:
|
|
|
|
`dijkstra {{source_node_file}}`
|
|
|
|
- Treat the graph as [d]irected when computing distances:
|
|
|
|
`dijkstra -d {{source_node_file}}`
|
|
|
|
- Record the [p]revious closest node for each node on the shortest path:
|
|
|
|
`dijkstra -p {{source_node_file}}`
|
|
|
|
- [a]ssign large distance values to unreachable nodes:
|
|
|
|
`dijkstra -a {{source_node_file}}`
|