<commit_before>package floydwarshall

// Grafos - Algoritmo de Floyd-Warshall em GO
// <NAME> - 2021
// https://github.com/xDouglas90
// link Go PlayGround: https://go.dev/play/p/4fOHMMxWxiy

// Algoritmo de Floyd-Warshall
func FloydWarshall(graph [][]int) [][]int {
	// Inicializa a matriz de distancias
	dist := make([][]int, len(graph))
	for i := range dist {
		dist[i] = make([]int, len(graph))
		copy(dist[i], graph[i])
	}

	// Percorre os vértices
	for k := 0; k < len(graph); k++ {
		// Percorre as linhas
		for i := 0; i < len(graph); i++ {
			// Percorre as colunas
			for j := 0; j < len(graph); j++ {
				// Verifica se o caminho passando pelo vértice k é menor
				if dist[i][k]+dist[k][j] < dist[i][j] {
					dist[i][j] = dist[i][k] + dist[k][j]
				}
			}
		}
	}

	return dist
}
<commit_msg>chore: Fix year and link in code comment<commit_after>package floydwarshall

// Grafos - Algoritmo de Floyd-Warshall em GO
// <NAME> - 2022
// https://github.com/xDouglas90
// link Go PlayGround: https://go.dev/play/p/tIRTHkNf7Fz

// Algoritmo de Floyd-Warshall
func FloydWarshall(graph [][]int) [][]int {
	// Inicializa a matriz de distancias
	dist := make([][]int, len(graph))
	for i := range dist {
		dist[i] = make([]int, len(graph))
		copy(dist[i], graph[i])
	}

	// Percorre os vértices
	for k := 0; k < len(graph); k++ {
		// Percorre as linhas
		for i := 0; i < len(graph); i++ {
			// Percorre as colunas
			for j := 0; j < len(graph); j++ {
				// Verifica se o caminho passando pelo vértice k é menor
				if dist[i][k]+dist[k][j] < dist[i][j] {
					dist[i][j] = dist[i][k] + dist[k][j]
				}
			}
		}
	}

	return dist
}

{'fraction_non_alphanumeric': 0.18265119120342088, 'fraction_numerical': 0.012217470983506415, 'mean_word_length': 2.9757281553398056, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5381888', 'n_tokens_mistral': 738, 'n_tokens_neox': 673, 'n_words': 175}