#include <iostream>
#include <vector>
#include <queue>
#include <unordered_set>
using namespace std;
class Graph {
public:
int V;
vector<vector<int>> adj;
Graph(int V) {
this->V = V;
adj.resize(V);
}
void addEdge(int u, int v) {
adj[u].push_back(v);
adj[v].push_back(u);
}
};
// 贪心算法着色函数
int greedyColoring(Graph& graph) {
// 存储每个节点的颜色
vector<int> colors(graph.V, -1);
// 从第一个节点开始遍历
for (int u = 0; u < graph.V; u++) {
// 存储相邻节点已经被使用的颜色
unordered_set<int> usedC