<commit_before>#include <iostream>
#include <vector>
#include <fstream>
#include <algorithm>
#include <utility>
#include <libgen.h>
#include <set>
#include <queue>

using namespace std;

typedef pair<int, int> edge_t;

class Network {
	public:
		void read(istream& input);
		int degree(int node) const;
		int nEdges() const;
		int nNodes() const;
		int largestComponentSize() const;
		
	private:
		vector<edge_t> edges;
		int maxNode;

		vector<int> getColors() const;
};

void Network::read(istream& input)
{
	maxNode = 0;
	edges = vector<edge_t>();

	int from, to;
	while ((input >> from >> to))
	{
		edges.emplace_back(from, to);
		maxNode = max(maxNode, max(from, to));
	}

	sort(edges.begin(), edges.end());
}

int Network::nEdges() const
{
	return edges.size();
}

int Network::nNodes() const
{
	set<int> nodes;
	for (auto& edge : edges)
	{
		nodes.insert(edge.first);
		nodes.insert(edge.second);
	}

	return nodes.size();
}

int Network::largestComponentSize() const
{
	
	vector<int> colors = getColors();
	sort(colors.begin(), colors.end());

	// Now determine the longest streak
	int maxConnected = 0;
	for (int i = 0; i < maxNode; i++) {
		if (i % 10000 == 0) {
			cerr << i << endl;
		}
		int connected = 1;
		const int color = colors[i];
		if (color == 0) {
			continue;
		}
		for (i = i + 1; i < maxNode && colors[i] == color; i++, connected++);

		maxConnected = max(maxConnected, connected);
	}

	return maxConnected;
}

vector<int> Network::getColors() const
{
	if (edges.size() == 0) {
		return {};
	}

	vector<int> colors(maxNode + 1, 0);

	queue<int> todo;
	for (int i = 1; i < maxNode; i++) {
		if (colors[i] != 0) {
			continue; // Already colored this one.
		}

		todo.push(i);
		while (!todo.empty()) {<commit_msg>Verwijder debug output.<commit_after>#include <iostream>
#include <vector>
#include <fstream>
#include <algorithm>
#include <utility>
#include <libgen.h>
#include <set>
#include <queue>

using namespace std;

typedef pair<int, int> edge_t;

class Network {
	public:
		void read(istream& input);
		int degree(int node) const;
		int nEdges() const;
		int nNodes() const;
		int largestComponentSize() const;
		
	private:
		vector<edge_t> edges;
		int maxNode;

		vector<int> getColors() const;
};

void Network::read(istream& input)
{
	maxNode = 0;
	edges = vector<edge_t>();

	int from, to;
	while ((input >> from >> to))
	{
		edges.emplace_back(from, to);
		maxNode = max(maxNode, max(from, to));
	}

	sort(edges.begin(), edges.end());
}

int Network::nEdges() const
{
	return edges.size();
}

int Network::nNodes() const
{
	set<int> nodes;
	for (auto& edge : edges)
	{
		nodes.insert(edge.first);
		nodes.insert(edge.second);
	}

	return nodes.size();
}

int Network::largestComponentSize() const
{
	
	vector<int> colors = getColors();
	sort(colors.begin(), colors.end());

	// Now determine the longest streak
	int maxConnected = 0;
	for (int i = 0; i < maxNode; i++) {
		int connected = 1;
		const int color = colors[i];
		if (color == 0) {
			continue;
		}
		for (i = i + 1; i < maxNode && colors[i] == color; i++, connected++);

		maxConnected = max(maxConnected, connected);
	}

	return maxConnected;
}

vector<int> Network::getColors() const
{
	if (edges.size() == 0) {
		return {};
	}

	vector<int> colors(maxNode + 1, 0);

	queue<int> todo;
	for (int i = 1; i < maxNode; i++) {
		if (colors[i] != 0) {
			continue; // Already colored this one.
		}

		todo.push(i);
		while (!todo.empty()) {
{'fraction_non_alphanumeric': 0.1708381839348079, 'fraction_numerical': 0.008149010477299184, 'mean_word_length': 3.840845070422535, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 45, 'https://': 0, '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': '780784', 'n_tokens_mistral': 1398, 'n_tokens_neox': 1280, 'n_words': 349}