Category : graph

How can I implement the greedy algorithm to get the full coloring of the graph? That is, not only color the adjacent vertices with different colors, but also color the edges with different colors of their vertices? Using as few colors as possible. As in the image below: Total coloring graph // A C++ program ..

Read more

i have created two functions for finding paths between two vertices in a adjacency matrix. first function countPath run for each edge of source vertex; void countPath(int s,int d){ int count=0; for (int i = 0; i < V;i++){ if(visited[i]==0&&adj_mat[s][i]==1){ cout << s << " "; searchForNode(i, d, &count); } } cout << count << ..

Read more

I’m implementing an algorithm in C++ with Boost Graph. I want to find all the vertex in the neighborhood of v (so, all its neighbors), then change a property of their and finally clear all of their edges. I found in Boost the function adjacent_vertices(v,g) (where v is the vertex and g is the graph) ..

Read more

Given a graph , the edges are classifed into good and bad (two vertices are said to be good neighbor only if there is good edge between them) Our goal is to select a maximal set of vertices: • For every vertex in the above set (all of its good neighbous must also be included). ..

Read more