It is well know that in the case of weighted graph with positive weights, the dimension of the kernel of the Laplacian is the number of connected components of the corresponding graph.
This fails when negative weights are allowed, but I was wondering if this remained true if we restrained ourselves to bipartite graph?
In other words, for bipartite graphs with possibly negative weights, is the number of connected components the dimension of the kernel of the associated Laplacian?
If I haven't made any error in my code, the answer is no
Here is a counter example:
$L=\begin{bmatrix} 1 & 0 & 0 & -1 & 0 & 0\\ 0 & 3 & 0 & -1 & -1 & -1\\ 0 & 0 & 2 & 0 & -1 & -1\\ -1 & -1 & 0 & 2 & 0 & 0\\ 0 & -1 & -1 & 0 & 2 & 0\\ 0 & -1 & -1 & 0 & 0 & 2\\ \end{bmatrix} $
This graph is connected, and the Laplacian has eigenvalues $\left({(5 + \sqrt{17})/2, 3, 2, 2, (5 - \sqrt{17})/2, 0}\right)$
Now take the weights:
$L_w= \begin{bmatrix} 1. & 0. & 0. & -1. & 0. & 0.\\ 0. & 1. & 0. & 2. & -4. & 1.\\ 0. & 0. & -3. & 0. & 4. & -1.\\ -1. & 2. & 0. & -1. & 0. & 0.\\ 0. & -4. & 4. & 0. & 0. & 0.\\ 0. & 1. & -1. & 0. & 0. & 0.\\ \end{bmatrix} $
this has eigenvalues $({-6.82741, 5.88255, -2.55556, 1.50042, 0, 0})$.
for completeness, here is the python code I used to find the counterexample:
Edit
my example has a diagonal element $0$ artificially (some weights cancel out) but this is not necessary. One can adapt the code adding/replacing with this piece, and still get counterexamples