Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
A minimum spanning tree gives the cheapest way an undirected graph. But what is a minimum spanning forest? Is it defined for connected graphs or unconnected graphs?
Minimum spanning forest is a generalization of minimum spanning tree for unconnected graphs. For every component of the graph, take its MST and the resulting collection is a minimum spanning forest.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
how can I get longest path in unweighted undirected graph if each node can be visited only once? Thanks for help! // I am new to graphs.I've found out that each edge can be visited only once,not node.Node can be visited more times.Does it mean that my graph is directed? Thanks
This is obviously an NP-complete problem, as Hamiltonian path problem can be reduced to this one. So you will most probably have no polynomial solution here. For non-polynomial you can just use brute force, or try to adapt numerous Hamiltonian path approaches.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 7 years ago.
Improve this question
If a graph unweighted G have the same number of Nodes and Edges , it is correct to assume that the graph G just contain one cycle ? Can be proved ?
EDIT: And all node are conected
If and only if there are one component in a graph. In other words, if from each node, there is a path to any node in a graph, you can assume that there are exactly one cycle.
You are assuming that all the nodes in the graph are connected. If the nodes in the graph are not connected, then answer to your question is no.
Also graph has to be a simple graph(https://en.wikipedia.org/wiki/Graph_(mathematics)?oldformat=true#Simple_graph)
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
If my directed graph is represented as its incidence matrix how do I apply topological sort on that graph? I think it can be done by finding null rows and removing them with their corresponding columns but this is not efficient.How can I do this more efficiently?
I assume this is homework. Try the following algorithm:
1) Identify all of the nodes with indegree 0 (no edge points into the node)
2) For each node from step 1, perform a depth-first-search walk starting from the node.
If the graph is a DAG (directed acyclic graph -- no directed cycles like A -> B, B -> C, C -> A), the order in which you see nodes is guaranteed to be a topological ordering.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Prove that if G is an undirected connected graph, then each of its edges is either in the depth-first search tree or is a back edge.
Now, from intuition and in class lectures by Steven Skiena, I know that the above holds true, since it dives all the way down, and then throw a rope back to a previous vertex. I also know that DFS is great in finding cycles.
However, my problem here is that I don't know how to 'prove' that the edge is either a tree edge or a back edge.
Consider the 4 cases possible (theoretically). An edge can be:
A tree edge
A back edge
Both a tree edge and a back edge
Neither a tree edge or a back edge
To prove what is needed, you need to show that cases 3 and 4 cannot happen, i.e. lead to a contradiction.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I was trying to solve a basic clique problem but i have stucked at some following points:
what is is the minimum size of the largest clique in any graph with N nodes and M edges
To Find the largest clique in a graph
Please tell me difference between above two statement.
The first is a question about the set of all graphs with N nodes and M edges. The second question appears to be about a particular graph (although it seems to be out of context).
It might be better to ask this on https://math.stackexchange.com/