Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
3 votes
0 answers
195 views

Lowest cost path through elements in a matrix

I've developed a program in Python that calculates the lowest possible costing path between two points in a matrix, including the values contained in the start and finish cells. The code is below. ...
MrJoe's user avatar
  • 2,163
2 votes
1 answer
235 views

Finding valid path on 2D Grid

I got a 2D grid (n x n matrix). The user selects his player in this 2D grid and after that selects another node in this grid to mark his destination position. The player is allowed to move ...
dehlen's user avatar
  • 143
2 votes
3 answers
2k views

Find the longest path in a matrix where each step has entries that differ by 1

Given an N*N matrix that all numbers are distinct in it, the function should find the maximum length path (starting from any cell) such that all the cells along the path are in increasing order with a ...
BOIDEM's user avatar
  • 31
7 votes
3 answers
9k views

Using a greedy algorithm to find the best path in a 2D array

I'm a student and this is one of my assignments. My professor basically confirmed that my code is correct but all he grades on is if I finished the assignment correctly but not the coding style. I ...
Bishoy Boktor's user avatar
5 votes
1 answer
2k views

Shortest path in image

This code takes an image and detects a global shortest path from the top to bottom row, with the requirement that top and bottom column index be the same. For this, it scans through each element on ...
ChrisF's user avatar
  • 61
2 votes
0 answers
342 views

A* search algorithm in Clojure

Cost of nodes are represented by a matrix (called world), heuristic cost estimate/g score/f score are all represented in matrices. The world and its size are ...
qed's user avatar
  • 1,439
2 votes
2 answers
4k views

Finding paths through matrix

Given the problem: You are given a 2-Dimensional array with M rows and N columns. You are initially positioned at (0,0) which is the top-left cell in the array. You are allowed to move either ...
Matthew Hoggan's user avatar
2 votes
2 answers
12k views

Finding a route in maze matrix

Maze puzzle A 1 in input matrix means "allowed"; 0 means "blocked". Given such a matrix, find the route from the 1st quadrant to the last (n-1, n-1). I would like to get some feedback to optimize ...
JavaDeveloper's user avatar
5 votes
1 answer
1k views

Path sum - Dijkstra's algorithm in F#

I'm learning F# and I've decided to solve Project Euler's Problem #81 with Dijkstra's algorithm. In the 5 by 5 matrix below, the minimal path sum from the top left to the bottom right, by only ...
Asik's user avatar
  • 341