Until you remove the politicians gerrymandering will always be an issue.No mere computer program can solve that aspect.
Here's what I found more than a little ironic about gerrymandering.
The Justice Department decided that only a black person can represent a black person's interests, so they approved districts that lump lots of black people together (including at one point a district that included only one lane of Interstate 85 in North Carolina) so they could get a black-majority district so black people could be represented.
Two problems.
1. With a big hunk of black Virginians in the Va 3rd District, black voters elsewhere in the state lost a lot of political clout. Democrats knew they had them and Republicans knew they could not get them, so neither tried wooing black voters.
2. I lived in the Va 3rd while Bobby Scott was carrying Bill Clinton's water in the House. If only a Rep. of the same color as the voter can represent that voter, who was my representative? Justice's answer:
virtual representation: other white Representatives were representing my interests in Congress while I was living in the Va. 3rd. The colonies fought a war against the idea of virtual representation in Parliament, because the idea is ridiculous.
Race-based gerrymandering. An anti-American idea that politically marginalizes black people. Brought to you by the Justice Department. Way to go fellas.