Implement a function to find the number of bipartite partitions in a graph represented by its vertices and edges. A bipartite graph can be divided into two disjoint sets such that no two graph vertices within the same set are adjacent. The function should return the number of such partitions and a string representation of one of the possible partitions.
Input Requirements
The function find_bipartite_partitions(N, M, edges) takes three parameters:
N (int): The number of vertices in the graph (1-indexed).
M (int): The number of edges in the graph.
edges (list of tuples): A list of tuples, where each tuple (u, v) represents an edge between vertices u and v.
Output Requirements
The function should return:
A tuple containing:
An integer representing the number of bipartite sets.
A string representation of one of the possible partitions, where vertices in one set are denoted by '1' and those in the other set by '0'.
Implementation
Your solution must be written in a file named /app/solution.py.
Ensure to handle cases where the graph might not be bipartite.
Example
Input:
python
N = 4
M = 4
edges = [(1, 2), (1, 3), (2, 4), (3, 4)]
Output:
python
(2, '1100')
Edge Cases
Consider graphs with no edges, and graphs that are fully connected.
Handle 1-indexed vertex inputs correctly.
Implement the above specifications in the designated file.