n10ty / testtask

This is implementation to find shortest path in the maze

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Description

Algorythm allows to find a shortest path in maze.

input:

....................................
..S...#......................#......
......#......................#......
.............................#......
....................................
....................................
..............#.....................
............#.......................
..........#.........................
....................................
.....................#..........#...
.....................#....X.....#...
.....................#..........#...
....................................

output: d,d,d,d,d,d,d,d,d,d,d,d,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,u,u,u

Build image

docker build --tag my_testtask .

To run test

docker run my_testtask:latest /bin/sh -c "mvn test"

To run local from file

cd pathfinder && mvn package && java -jar target/TestTask.jar maze.txt

To run local from stdin

cd pathfinder && mvn package && java -jar target/TestTask.jar < maze.txt

Performance

Algorithm has linear operation complexity: 170k ~ 3.4s 85k ~ 1.1s

About

This is implementation to find shortest path in the maze


Languages

Language:Java 99.5%Language:Dockerfile 0.5%