Bees Algorithm in C: How It Works and an Implementation
The Bees Algorithm combines random scouting with local search around the best sites. This guide explains it and gives a complete C implementation.
Spread Your Knowledge. Questions with answers, tutorials and articles, newest first.
The Bees Algorithm combines random scouting with local search around the best sites. This guide explains it and gives a complete C implementation.
How tabu search and ACO differ, with complete C17 implementations of both for the travelling salesman problem.
ACO solves hard routing problems by simulating ants that follow pheromone trails. This guide explains the algorithm and gives a complete C implementation for the TSP.
Tabu Search escapes local optima by forbidding recent moves for a set number of iterations. This guide implements it in C for a small TSP.
Simulated annealing refines a single solution with a cooling schedule, while PSO moves a swarm of particles. Compare them with runnable C code and a decision guide.
Particle swarm optimization in C needs only structs, arrays and a loop. This guide gives a complete C17 program, its output and tips for adapting it.
Simulated annealing escapes local minima by accepting worse moves with a probability that falls as the temperature cools. See a complete C implementation.
A local search improves one solution step by step; a genetic algorithm evolves a population. See the differences and a runnable C comparison.
A genetic algorithm evolves candidate solutions with selection, crossover and mutation. See a complete C implementation, how each operator works and how to adapt it.
A local search algorithm improves one candidate solution by moving to better neighbours. See hill climbing and simulated annealing in C and how they avoid local optima.
Brute force checks every solution and finds the optimum, while a heuristic is fast but approximate. See both on the travelling salesman problem in C.
Learn what a heuristic algorithm is and how to implement one in C, with a greedy 0/1 knapsack heuristic and a complete A* pathfinding program.
A brute-force algorithm tries every candidate until one works. See working C examples for pairs, strings, subsets and recursion, plus their cost.
Backtracking explores and undoes choices, while divide and conquer splits a problem into independent parts and combines them. Compare both with N-Queens and merge sort in C.
Divide and conquer splits a problem into smaller subproblems, solves them recursively and combines the results. This guide shows C implementations with complexity.
Backtracking builds a solution step by step and undoes choices that fail. This guide explains the pattern and gives tested C code for N-Queens and subset sum.
Greedy picks the best local choice, dynamic programming reuses stored subproblem results. See working C examples and when each approach is correct.
Dynamic programming stores answers to overlapping subproblems so each is computed once. This guide shows memoisation and tabulation in C with three worked problems.
A greedy algorithm picks the best local choice at each step. See when it is optimal and how to implement it in C with working examples.
Dijkstra finds shortest paths from a source, Prim builds a minimum spanning tree. See both in working C code with complexity and use cases.