---
id: 0095d0567b6817114989a1dd
title: Step 1
challengeType: 1
dashedName: step-1
---

# --description--

In this workshop, you will implement the shortest path algorithm in JavaScript. You will write a function that computes the shortest path between nodes in a weighted graph and returns both the distances and the paths taken.

For example, given a graph where cities are connected by roads with different distances, the algorithm will find the shortest route from one city to another. If you want to travel from City A to City D, the algorithm might find that going A ⇨ B ⇨ C ⇨ D (total: 15km) is shorter than going directly A ⇨ D (20km).

To get started, define a variable named `INF` and assign it the value `Infinity`. Later, you'll use it to indicate that there is no direct connection between two nodes.

# --hints--

You should define a variable named `INF`.

```js
assert.isDefined(INF);
```

Your `INF` variable should have the value `Infinity`.

```js
assert.strictEqual(INF, Infinity);
```

# --seed--

## --seed-contents--

```js
--fcc-editable-region--

--fcc-editable-region--
```
