private int getNbrCost(String fromId) {
        for (NbrCostPair ncp : nbrList) {
            if (ncp.getNbr().getId().equalsIgnoreCase(fromId)) return ncp.getCost();
        }
        return 0;
    }