Tell me how you would find and rank nearby hosts for Neighbor using graph-based neighbor discovery and related algorithms.
Implement rank_nearby_hosts(graph, start, host_scores, k). graph maps each node ID to adjacent node IDs, and host_scores maps host IDs to numeric scores. Return up to k reachable hosts, excluding start, ordered by shortest graph distance, highest score, then lexicographically smallest host ID.
def rank_nearby_hosts(graph, start, host_scores, k):