I have a undirected and unweighted (or all edges are weighted 1) acyclic graph (G=VxE). Some of this graph's nodes are selected as sV (sV is subset of V). Problem is, I want to find the subgraph covering all selected nodes. Naturally some non selected nodes can be covered. But the nodes that are not on the desired subgraph are restricted. These restricted nodes should not be in the solution subgraph unless they are on only the one path between two selected nodes. An example:
A B C D
A - + + -
B + - + -
C + + - +
D - - + -
A, B, C, D are nodes, + represents inclusion of edges. For this graph B and D are selected nodes. The solution I want for this example is as follows: The subgraph consists nodes B,C,D and edges (B,C), (C,D) *. Note that A is not in the subgraph as intended. What kind of approach helps me to find this type of subgraphs? Thanks for ideas.
*(X,Y) represent an edge between nodes X an Y.