How to ask for code from authors who have proposed algorithms in computer science?
Tell them what you told us. You are working on a different algorithm and implementation for the same problem and you'd like to compare to the state of the art. You've read their papers (cite them), and you'd like to see if their code is available for cross-comparison. 

If they don't make theirs available, you may have to reimplement their algorithm in your code as well. This latter case is pretty common. There's a chance you might not do this as well as them, so there's some incentive for them to give you their code to get a proper comparison done.