AI Algorithms Visualizer

10 algorithms · Demo, Algorithm Structure, and Code views

Neural network: signals propagate forward through weighted layers from input → hidden → output.
2Epoch: 0
Demo
Algorithm
Code
Problem: Pattern recognition. The network learns input→output mappings by adjusting weights. Signals flow forward, errors flow backward (backpropagation). More hidden layers = more complex patterns.
Bayesian network: evidence updates beliefs across nodes via conditional probability. Click a node or use Auto.
Click a node
Demo
Algorithm
Code
Problem: Reasoning under uncertainty. Observing one event (wet grass) updates beliefs in all connected events (rain, sprinkler) via probability propagation.
Particle filter tracks a moving object under sensor noise. Particles cluster around the most probable location.
200Particles: 200
Demo
Algorithm
Code
Problem: Tracking a moving object with noisy sensors. Hundreds of hypothetical positions converge on the true location via predict → weight → resample.
Genetic algorithm evolves paths toward the shortest route (TSP). Select → crossover → mutate each generation.
18Gen: 0
Demo
Algorithm
Code
Problem: Travelling Salesman — find shortest route visiting 18 cities. The GA mimics natural selection to evolve near-optimal solutions.
Q-learning agent explores a grid, collecting rewards and avoiding hazards. Watch the value map warm up.
Ep: 0
A
Agent
Reward
Hazard
Learned
Demo
Algorithm
Code
Problem: Learning optimal behavior through trial and error. The agent balances exploration vs exploitation, building a Q-table of state-action values.
K-means assigns points to nearest centroid, then recalculates centroids. Watch it converge.
4Iter: 0
Demo
Algorithm
Code
Problem: Unsupervised grouping. Discovers natural clusters by iterating assign → update until centroids stabilize.
Fuzzy logic maps crisp inputs to outputs via membership functions and IF-THEN rules.
Fan: 50%
Demo
Algorithm
Code
Problem: Control with human-like reasoning. Partial truth ("60% warm, 30% hot") and rules blend into smooth output via centroid defuzzification.
Decision tree classifies data by asking yes/no questions at each node, splitting until leaves are pure.
Depth: 0
Demo
Algorithm
Code
Problem: Classification. Given labeled data points (two colors), the tree recursively finds the best axis-aligned split to separate classes — like playing 20 Questions. Left shows the growing tree, right shows the data space being partitioned.
A* pathfinding finds the shortest path through a grid with walls, using heuristic + cost to prioritize search.
Searching...
Start
Goal
Wall
Open
Closed
Path
Demo
Algorithm
Code
Problem: Shortest path through obstacles. A* combines actual cost from start (g) with estimated cost to goal (h) to efficiently explore — expanding the most promising nodes first. Blue = candidates, purple = explored, yellow = final path.
Gradient descent rolls a ball downhill on a loss landscape, following the steepest slope to find the minimum.
0.08Step: 0
Demo
Algorithm
Code
Problem: Optimization — finding the minimum of a function. The "ball" follows the negative gradient, taking steps proportional to the learning rate. Too high = overshoots, too low = crawls. This is the foundation of all neural network training.