how to find the original directed graph? - graph

I was thinking on a homework question given to me, it is as follows:
If you are given with a BFS and DFS traversal of a directed( or un-directed graph),
how would you find the original graph ?
Is it possible in either case?
thankyou

If I understand it correctly, it is not possible, since BFS and DFS produce a tree, and tree has |V|-1 edges. So, in these two trees you have at most 2|V|-2 different edges, and original graph can have up to |V|(|V|-1) edges for directed, and |V|(|V|-1)/2 for undirected graph.

Related

algorithm for 'generalized' matching in complete graphs

My problem is a generalization of a task solved by [Blossom algorithm] by Edmonds. The original task is the following: given a complete graph with weighted undirected edges, find a set of edges such that
1) every vertex of the graph is adjacent to only one edge from this set (i.e. vertices are grouped into pairs)
2) sum over weights of edges in this set is minimal.
Now, I would like to modify the first goal into
1') vertices are grouped into sets of 3 vertices (or in general, d vertices), and leave condition 2) unchanged.
My questions:
Do you know if this 'generalised' problem has a name?
Do you know about an algorithm solving it in number of steps being polynomial of number of vertices (like Blossom algorithm for an original problem)? I don't see a straightforward generalisation of Blossom algorithm, as it is based on looking for augmenting paths on a graph compressed to a bipartite graph (and uses here Hungarian algorithm). But augmenting paths do not seem to point to groups of vertices different than pairs.
Best regards,
Paweł

Directed Graph to DAG

Does anyone have an algorithm for this problem? :
"Suppose we have a directed graph with n vertices and we want to make it acyclic.
How many sets of edges can we pick so that reversing the edges inside any one of those sets will make the graph acyclic?"
I can find the loops inside a graph,but i'm wondering if reversing one of edges of a loop , will produce another loop.

What's the difference between undirected graph and unweighted graph? Are they the same thing?

What's the difference between undirected graph and unweighted graph? Are they the same thing? Just want to be 100% sure.
I'm new to all this. Please don't lock I just need help and would like to learn.
Undirected graph means that his edges do not have any orientation, you can traverse it in both ways. Unweighted graph means that his edges are assumed to be the same length (or that the length does not matter).

How many Complete Graph present in given undirected Graph?

Is there a known algorithm to find all complete sub-graphs within a graph? I have an undirected, graph and I need to find all complete graphs present in that undirected graph.
Is there an existing algorithm for this?
Finding the number of complete subgraphs in an undirected graph is known as the clique problem. It is not solvable in polynomial time, since the number of complete subgraphs itself might be exponential. Therefore, there is not an algorithm that will solve this for graphs of any size in a reasonable amount of time. However, here is one I found that should work for small graphs:
https://en.wikipedia.org/wiki/Bron%E2%80%93Kerbosch_algorithm

Finding all maximal transitive closured subgraphs in given graph

I'm trying to solve the following problem:
I have an directed graph G = (E,V) which has a low number of edges. Now I try to find all subgraphs in it which are transitive closured and maximal which means there should be no subgraph which ist part of another subgraph.
The first idea I had was to start at every Node doing a DFS and on every step look if all edges for the closure exists but the performance is horrible. So I wonder if there is any faster algorithm

Resources