Re: A graph problem
On Mar 30, 2:29 pm, "Mahdi" <mahdi.dabest...@xxxxxxxxx> wrote:
Hello!
We have a graph that is not directional. We want an algorithm to find
out if this graph is divided to two parts or not.
mofid
This is pretty basic. Pick a node. Search from there with depth-
first or breadth-first search (take your pick), marking nodes as you
find them. If you eventually mark all nodes, there is only one part.
If the search terminates with unmarked nodes, you can continue to find
the other part(s) by picking an unmarked node and searching again (and
again).
.
Relevant Pages
- Re: Shortish paths
... For how many nodes and how many edges will the actual algorithm run ... original graph. ... optimal solution is removed from the graph, ... I intend to begin by rereading the shortest path sections of Cormen ... (comp.theory) - Re: Standard graph API?
... isomorphism graph library. ... It's pretty uniformly agreed that there is no standard graph ... the algorithm can't be specialized for the graph at ... My thought is to use some sort of templating system. ... (comp.lang.python) - Difference between two systems of DAGs
... I am looking for a graph algorithm, ... carry no label or other information except direction. ... edit operations are to change the label of a vertex or the ... (comp.theory) - Re: Vertex Cover implementation
... i code this simple greedy algorithm for the vertex cover: ... As you are constructing your graph you can update the vertex ... each edge appears on two adjacency lists. ... reason to use a priority queue for your algorithm. ... (comp.theory) - Re: combinatorial optimization problem (six-pick wager grouping)
... versed in graph theoretic approaches could comment on my ideas below - ... I'n not a graph theorist, nor a graph algorithm buff, so I can't really ... attempt to merge it with each bet already in the pool. ... million edges when I ignored wager size. ... (comp.programming) |
|