Category: C++ / MFC / STL
A simple C++ implementation of Kruskal’s algorithm for finding minimal spanning trees in networks. Though I have a previous posting that accomplishes exactly the same thing, I thought that a …
By definition you cannot sort a std::map by value, since a std::map sorts its elements by key. This posting documents a way to get around this by dumping std::map key-value …
After playing around with some graph algorithm code as implemented by Sedgewick and others, I have come to the conclusion that while these are efficient and concise, improvements could be …
Ever wondered what computer algorithm gets employed when using Ctrl-F to search for specific words in a page of text?
A short posting demonstrating how to remove the const-ness of a const_iterator, given that it is not possible to use re-casting along the lines of const_cast<> to convert from const_iterator …
IntroductionWhat are smart pointers? They are a means of handling the problems associated with normal pointers, namely memory management issues like memory leaks, double-deletions, dangling pointers etc. This post gives …
IntroductionFollowing on from a previous post which was concerned with finding all possible combinations of paths between communicating end nodes, this algorithm finds the top k number of paths: first …
IntroductionFollowing on from a previous posting on Simulated Annealing applied to travelling salesman problems, here is a posting that carries on in a similar vein, this time focusing on genetic …
IntroductionFollowing from a previous post, I have extended the ability of the program to implement an algorithm based on Simulated Annealing and hill-climbing and applied it to some standard test …
IntroductionSome initial results from experimenting with the 2-opt heuristic and applying it to a standard traveling salesman test problem.C# / WPF equivalent implementation can be found here:https://www.technical-recipes.com/2017/applying-the-2-opt-algorithm-to-travelling-salesman-problems-in-c-wpf/A summary of the …