Lets say $G$ is complete undirected graph with a set of edges coloured either black or red. The problem is to find an algorithm answering if it is possible to remove a subset of nodes from $G$ in a way such that all black edges are gone, but for any two nodes in the set of removed nodes there was no red edge between them.
I think I found a solution: If the graph has more than one black strongly connected components, then the answer is "no", because then there are two black edges $E_1$ and $E_2$ with no common nodes, and for every black edge at least one of its nodes should be removed to remove that edge from graph, and for any pair of nodes of $E_1$ and $E_2$ we choose to remove, there is a red edge between them, so we fail. Otherwise, we can sort all nodes by the number of linked black edges in descending order and then iterate this list node by node removing them from graph. If for current node there is a linked red edge, then mark the node on other end as "dangerous", and if we come across such node before all black edges are gone, then answer is "no". Otherwise, when there is no black edges, stop and answer "yes".
But now I want to prove this algorithm is correct. I think the case of more than one black SCCs is simple and doesn't require anything more rigorous, but the other case is more complicated and I'm not even entirely sure it's correct. Currently this is where I got:
Lets say the strategy of always removing a node with more linked black edges first is incorrect. Then it means, such strategy can make algorithm answer "no" when there was an other way to choose nodes which would make algorithm answer "yes". Then there is a step where some max-black-edges node $X$ is improperly chosen. Lets take a look at set of its black-adjacent nodes $S$. If all of them have the same number of linked black edges as $X$, then all other choices are symmetric and we will fail anyway, otherwise, there are nodes with less linked black edges than $X$ which means there are at least two nodes in $S$ which have a red edge between them. And to remove all black edges that make nodes in $S$ black-adjacent to $X$, we should remove all these nodes, so we will remove two with that red edge, so such strategies are incorrect and max-black-edges nodes should always be removed first.
I think this proof is somewhat naive and vague (especially in the end) and maybe even incorrect, so I'm seeking suggestions to make a better one. Not necessarily super-formal, but at least something which is sufficiently strict and believable.