A* hardcore algorithm shiz