Esempio n. 1
0
  private void crearGrafoDePartidosArreglados(int cantidad, int cantPartidosArreglados) {
    partidosArreglados = new Grafo();
    for (int i = 0; i < cantPartidosArreglados; i++) {
      partidosArreglados.agregar(s.nextInt(), s.nextInt());
    }

    // Agrego los nodos sin ejes.
    if (partidosArreglados.getListaAdyacencia().keySet().size() != jugadores) {
      for (int i = 1; i <= jugadores; i++) {
        if (!partidosArreglados.tieneNodo(i)) {
          partidosArreglados.agregar(i);
        }
      }
    }
  }