Top "Graph-theory" questions

A graph is a mathematical structure that contains a collection of vertices or 'nodes' and a collection of edges that connect pairs of vertices.

Best algorithm for detecting cycles in a directed graph

What is the most efficient algorithm for detecting all cycles within a directed graph? I have a directed graph representing …

algorithm graph-theory directed-graph
When is it practical to use Depth-First Search (DFS) vs Breadth-First Search (BFS)?

I understand the differences between DFS and BFS, but I'm interested to know when it's more practical to use one …

algorithm graph-algorithm graph-theory depth-first-search breadth-first-search
Finding all cycles in a directed graph

How can I find (iterate over) ALL the cycles in a directed graph from/to a given node? For example, …

algorithm graph-theory graph-algorithm
When should I use Kruskal as opposed to Prim (and vice versa)?

I was wondering when one should use Prim's algorithm and when Kruskal's to find the minimum spanning tree? They both …

algorithm graph-theory minimum-spanning-tree prims-algorithm kruskals-algorithm
Why is the time complexity of both DFS and BFS O( V + E )

The basic algorithm for BFS: set start vertex to visited load it into queue while queue not empty for each …

algorithm time-complexity graph-theory breadth-first-search
Find all paths between two graph nodes

I am working on an implemtation of Dijkstras Algorithm to retrieve the shortest path between interconnected nodes on a network …

algorithm graph-theory graph-algorithm breadth-first-search
How to draw a graph in LaTeX?

First of all, let me say I'm using LyX, though I have no problem using ERT. Secondly, what is the …

latex graph-theory lyx
Find the paths between two given nodes?

Say I have nodes connected in the below fashion, how do I arrive at the number of paths that exist …

algorithm path graph-theory pseudocode
Cycles in an Undirected Graph

Given an undirected graph G=(V, E) with n vertices (|V| = n), how do you find if it contains a …

algorithm graph graph-theory
Difference between hamiltonian path and euler path

Can some one tell me the difference between hamiltonian path and euler path. They seem similar!

algorithm graph graph-theory hamiltonian-path euler-path