A solver for BGP