(PHP / SQL)
(1 way to do this, I've never actually calculated player rank, but this came to mind)
player_stats
-- player_id
-- wins (int)
player_id | wins
1 8
2 99
3 1
4 40
// find who the current player should play against
// +/- 10 wins
"select * from `player_stats` where wins Between ($current_user_wins - 10) AND ($current_user_wins + 10) limit 1"
"Also, how would your scoring system encourage weaker players to play against stronger players and stronger players to want to play against the weaker players."
// find a random opponent
// from a larger pool
// + / - 50 wins for a bigger pool
"select * from `player_stats` where wins Between ($current_user_wins - 50) AND ($current_user_wins + 50) order by RAND() limit 1"
(Be sure to mind any negative values and results with 0 rows)
For overall rank, I think I'd find the player with the most games played or store it somewhere and calculate each players rank out of that - ie: if the most games played by any given player was 100, player 2 would be at the top, player 3 at the bottom and player 4 somewhere in the middle