How does Branagh deal with the problem that led to the heated debate during the following centuries in his film on Hamlet?
It seems that, once Dr. Freud's ideas about psychosis entered our consciousness, we began looking for sexual relationship everywhere. So, if you are referring to whether Hamlet has an Oedipal complex (a sexual fixation on his mother), then you must remember that this wouldn't have been a question asked for centuries, but rather only since the beginning of the 20th century.
Kenneth Branagh chooses to ignore this "insight" into Hamlet's nature altogether, not presenting any hint of sexual attraction between Hamlet and Gertrude. Instead, he focuses on the question that the play raises of whether Hamlet has, indeed, taken Ophelia's viriginity before the events of the play transpire. He decides upon a definitive, "yes," inserting an invented scene between Hamlet and Ophelia in bed.
Personally, I am quite a fan of directors of plays (even filmed versions) making strong choices when it comes to interpretation. As long as the words of the text are not altered to suit a point of view, it seems that plays, unlike novels (for example), are built to accommodate interpretation of character and time and place. These elements should never be assumed by audience or reader to be definitively one thing or another. The nature of a "play" leaves them necessarily open to interpretation.