List three different types of “distance” other than the geographic distance for a routing algorithm to minimize in finding the shortest distance.
List three different types of “distance” other than the geographic distance for a routing
The three different types of “distance” for a routing algorithm to minimize in finding the shortest distance are as follows:
- Euclidean Distance
- Hamming Distance
- Manhattan Distance
Let's see these distances in detail.
1) EUCLIDEAN DISTANCE:
Euclidean distance is the distance between two points in a straight line of a plane.
The Euclidean distance for n-dimensions is found by the formula,
That is, we are calculating the square of the distance in each dimension, sum the squares, and then take the positive square root.
According to the Euclidean distance formula,
If we consider two-dimensional then the distance between two points in the plane with coordinates (x, y) and (a, b) is given by
dist((x, y), (a, b)) = √(x - a)² + (y - b)²
Example:
Find the Euclidean distance between points (2, -1) and (-2, 2).
dist((2, -1), (-2, 2)) = √(2 - (-2))² + ((-1) - 2)²
= √(2 + 2)² + (-1 - 2)²
= √(4)² + (-3)²
= √16 + 9
= √25
=5
Step by step
Solved in 4 steps