Explain further The Manhattan distance from cell C to cell I is 2 (moving 1 unit horizontally and 1 unit vertically).

Search for a command to run...

No comments yet. Be the first to comment.
In Part 1 of this series we explored the friendly foundations of machine learning: Classification Regression Clustering Neural networks Training Testing Overfitting Decision trees Reinforceme

Machine Learning with Trufa and Paula: A Friendly Guide to How Models Learn

The Microsoft Copilot Ecosystem

I love words, I compile words and always search what they mean. My native language is español and to my surprise there are not that many on line. México where I'm from has no official online language

Hey everyone, Roberto here and there and everywhere! We've all worked with data, we've all felt the pain of waiting. When you build a beautiful Power BI report, but the data is from yesterday. You have to wait for the nightly refresh to see the lates...

Certainly! In a grid-based pathfinding problem like the one described, the Manhattan distance is calculated by summing the absolute differences in the x and y coordinates of two points.
Let's take a closer look at the grid and the positions of cell C and cell I:
A (1, 1) B (2, 1) C (3, 1)
D (1, 2) E (2, 2) F (3, 2)
G (1, 3) H (2, 3) I (3, 3)
The x-coordinate represents the horizontal position of a cell, and the y-coordinate represents the vertical position. Each cell in the grid has a unique (x, y) coordinate pair.
In this example:
Cell C has coordinates (3, 1), because it's in the third column (x-coordinate) and the first row (y-coordinate).
Cell I has coordinates (3, 3), because it's in the third column (x-coordinate) and the third row (y-coordinate).
To calculate the Manhattan distance between cell C and cell I:
Compute the absolute difference between their x-coordinates: |3 - 3| = 0.
Compute the absolute difference between their y-coordinates: |1 - 3| = 2.
Finally, sum the absolute differences: Manhattan distance = 0 (horizontal distance) + 2 (vertical distance) = 2.
So, the Manhattan distance from cell C to cell I is 2. This means that it would take two moves to reach cell I from cell C, moving 1 unit horizontally and 1 unit vertically.
Sure! Here's the updated grid with the coordinates added:
Now, each cell in the grid is labeled with its corresponding coordinates in the format (x, y), where:
x represents the horizontal position (column number).
y represents the vertical position (row number).
With these coordinates, it's easier to identify the positions of the cells and compute distances between them.