SPOJ VOCV

Problem Number - Problem Name

 * http://www.spoj.com/problems/VOCV/

Summary
The city of Y-O is a network of two-way streets and junctions with the following properties:

There is no more than one street between each pair of junctions. Every junction is connected to every other junction either directly via a street or through other junctions by a unique path. When a light is placed at a junction, all the streets meeting at this junction are also lit.

A valid lighting is a set of junctions such that if lights were placed at these, all the streets would be lit. An optimal lighting is a valid lighting such that it contains the least number of junctions.

The task is divided into two subtasks:

Find the number of lights in an optimal lighting. Find the total number of such optimal lightings in the city.

Explanation
Note
 * the given graph is not cyclic.
 * you either have to choose a vertex (or) you will definitely have to choose all the vertices connected to it.
 * the optimal answer will be achieved by selecting an node or not selecting a node.