For example, in graph
1
/ \
2 3 -- 4
We can pick 1 -- 2 and 3 -- 4 edges but not 1 -- 3 and 3 -- 4. Maximum number of edges we can pick such that no vertex is repeated twice is 2 (1 -- 2 and 3 -- 4).
Given an undirected graph how do I find maximum number of edges that can be picked such that no vertex is picked twice?
For example, in graph
1
/ \
2 3 -- 4
We can pick 1 -- 2 and 3 -- 4 edges but not 1 -- 3 and 3 -- 4. Maximum number of edges we can pick such that no vertex is repeated twice is 2 (1 -- 2 and 3 -- 4).