Skip to content

1terraflops/pathfinder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pathfinder

Pathfinder is a CLI tool that finds all the shortest paths between nodes.

💡 About Pathfinder

This projects demonstrates a pathfinding application that:

  • Reads from a specified file (see tests folder)
  • Creates a weighted graph from the input
  • Runs it through a pathfinding algorithm (Dijkstra's in this case)
  • Displays the results in the console
  • Handles errors gracefully throughout app's lifecycle

The idea was to learn more about graphs and pathfinding algorithms to build an application around it.

🔧 Built with

  • C
  • Make
  • libmx (custom library)
  • Valgrind

🚀 Getting started

These instructions will help you configure and compile this project to run it on your machine.

🧩 Prerequisites

Before trying to compile the application, make sure you have clang compiler and Make installed on your system:

  • On Linux (Ubuntu):
sudo apt install build-essential clang
  • On macOS:
xcode-select --install

⚠️ Important

You can skip this section if you are not using Linux.

Linux and macOS use a different header and function in order to get the size of allocated memory.

To successfully compile the program on Linux, navigate to libmx/inc/libmx.h. Open the header file and replace #include <malloc/malloc.h> with #include <malloc.h>. Then go to libmx/src/realloc.c and replace malloc_size function with malloc_usable_size.

⚙️ Installation

After cloning the repository, navigate to pathfinder root directory and simply run 'make' command:

make

The application should now be ready to run.

✅ Usage

Run the application with ./pathfinder command. This should result with usage output.

Specify the file you want to read in order to compute the paths. You can create your own files, or use test files from 'tests' folder:

./pathfinder tests/medium.txt

Output Example:

image

About

A pathfinding console application that calculates the shortest path

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published