Pathfinding Algorithms

We usually want to know the shortest/fastest route between two points. This is a well-known problem in graph theory. There are several algorithms that solve this problem: A*, Dijkstra, etc.

I have implemented in C++ those algorithms and a graph of the roads in California.

Continue reading “Pathfinding Algorithms”

Connect 4 AI Solver

Recurrent algorithms C++ and Python

I have been working on recurrent algorithms. They’re a bunch of examples in which you can implement these algorithms. However, we usually see that they are efficient.

Connect 4 is a simple game that can be easily programmed and solved to win every time. I have made in Python an AI that solves and wins. It is not programmed in C++ because I wanted a GUI.

Continue reading “Connect 4 AI Solver”

Lane Line Recognition

Lane line recognition algorithms

The Hough Transform has been broadly used in many fields, including autonomous cars. It is used to detect straight and curved lines with high accuracy.

 

This is the result of the Lane Line program I have designed to detect edges on the road.

The algorithm used, it is used to detect edges on images. Then, we discard using analytics and probability the ones which overlap each other and the less probable.

It is very efficient and can be used in parallel computing for rather good optimizations. The results are quite astonishing.

Continue reading “Lane Line Recognition”

Computational Fluid Dynamics (CFD)

Navier-Stokes + Incompressible + Finite difference method

Discretization methods for approximating the Partial Differential Equations (PDEs):

  1. Finite Difference (FD) \checkmark
  2. Finite Elements (FE)
  3. Finite Volume (FV)

Finite Difference (FD)

Taylor’s polynomial

    \[f(x_0 + h) = f(x_0) + \frac{f'(x_0)}{1!}h + \frac{f^{(2)}(x_0)}{2!}h^2 + \cdots + \frac{f^{(n)}(x_0)}{n!}h^n + R_n(x) \]

    \[f'(a)\approx {f(a+h)-f(a)\over h}. \]

    \[f'(a)\approx{f(a+h)+f(a-h)-2f(h)\over \Delta h^2 \]

Continue reading “Computational Fluid Dynamics (CFD)”

Modular Arithmetic Library

Modular Arithmetic Library in C++

This library provides the basics of modular arithmetic operations:

  • Great Common Divisor (GCD)
  • Least Common Multiple (LCM)
  • Bezout solver
  • Decomposition number algorithm
  • Euler’s totient function
  • a^{b}(mod\:m)
  • Primality Test
  • Find next Prime
  • Inverse function
  • Solver for 1 equation
  • Solver for multiple equations
-GitHub repository:

Modular Arithmetic Source Code

-Article

Modular Arithmetic Article


Continue reading “Modular Arithmetic Library”