digraph partitioning to subgraphs
Given a DAG with |V| = n and has s sources we have to present subgraphs such that each subgraph has approximately k1=√|s| sources and approximately k2=√|n| nodes.
If we define the height of the DAG to be the maximum path length from some source to some sink.
We require that all subgraphs generated will have approximately the same height.
The intersection of each pair of node Sets (of subgraphs) is empty.
You can see in 开发者_高级运维attached picture the example of right partition(each edge in the graph is directed upwards).
There are 36 nodes and 8 sinks [#10,11,12,13,20,21,22,23]in the example .So each subgraph should have 6 nodes and 2 or 3 sinks.
Do you have idea for algorithm?
Thank you very much
it seems you have missed some information,even if we assume the graph is indirectly connected. look at the following example.
you should have 3 vertices in each subgraph, however, look on vertex 6, if it is without 5 - we are done, because the graph is not connected, like you said it should be in the comment.
if it is - must be with at most one of {7,8,9} - let's say it's with 7. i.e. U={5,6,7}
let's now look on 8, let's say it is in U', since 5 is not in U', there is no possible solution, in which the subset U' will be connected.
please look again at the task description and give us more details, (or give this example as a counter-example to show it might be unsolveable)
精彩评论