Graph Traversals in C++ and C#

Breadth First Search From WikiPedia: “Breadth-first search (BFS) is an algorithm for traversing or searching tree or graph data structures. It starts at the tree root (or some arbitrary node of a graph, sometimes referred to as a ‘search key’) and explores the neighbor nodes first, before moving to the next level neighbors” I have …

Continue reading ‘Graph Traversals in C++ and C#’ »

Using depth first search to test graph connectivity in C++

Problem description Given a directed or undirected graph, determine whether it is connected or not. Specifically is it possible for any pair of nodes to communicate with each other? This brief post reproduces this web page whereby the problem was to determine whether a graph is strongly connected or not. I use a slight modification …

Continue reading ‘Using depth first search to test graph connectivity in C++’ »

A Recursive Algorithm to Find all Paths Between Two Given Nodes in C++ and C#

Problem Outline This I tackled previously when working on the design and implementation of routing optimization algorithms for telecommunications networks. Given that a wide area network with nodes and interconnecting links can be modelled as a graph with vertices and edges, the problem is to find all path combinations