A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

Questions tagged [taxicab-geometry]

The taxicab metric is also known as rectilinear distance, L1 distance or L1 norm (see Lp space), city block distance, Manhattan distance, or Manhattan length

7 questions
Filter by
Sorted by
Tagged with
66 views

Java solution to CodeChef “Surgical Strikes” challenge

I've just recently completed this programming "challenge" called surgical strikes: $N$ Indian Air Force fighter planes are located in different bases across the country. Each airbase is described ...
127 views

Compute Manhattan distance from origin given a set of left-right-step directions

I am solving the problems for Advent of Code 2016 to learn Rust programming. The prompt for the first problem can be summarized: I start at position 0,0 on a regular grid. I am given a set of ...
592 views

Optimized board representation for the 4x4 sliding puzzle

Inspired by this question and my answer to it I told myself I could try an optimized version for a 4x4 puzzle. There are only $16!$ possible states, so the state fits into a single ...
12k views

Optimizing Manhattan-distance method for N-by-N puzzles

By N-by-N puzzles I mean f.e. a 3x3 sliding puzzle with one blank space (so a 8-puzzle) or a 4x4 sliding puzzle (so a 15-puzzle). When I try to solve certain puzzles some take no time but others take ...
3k views

N-puzzle program solved using A* search

I coded the following program to solve the n-puzzle problem with n = 3. Are there any suggestions regarding readability and variable names? ...