graph coloring problem

Dec 10, 2010 at 7:22 AM

i want to solve graph coloring problem and i need to create colored graph aftre solving but i cant change the vertex color.

can you help me?

i have another problem:

my graph is bidirectional but edge has direction, i create 1->2 edge and 2->1 edge to show bidirectional

graph.AddEdge(new Edge<string>(FirstVertexTextBox.Text, SecondVertexTextBox.Text));

graph.AddEdge(new Edge<string>(SecondVertexTextBox.Text, FirstVertexTextBox.Text));

 

 but when i want to remove edges it dosnt work and dosnt remove them:

graph.RemoveEdge(new Edge<string>(FirstVertexTextBox.Text, SecondVertexTextBox.Text));  

graph.RemoveEdge(new Edge<string>(SecondVertexTextBox.Text, FirstVertexTextBox.Text));

Dec 11, 2010 at 7:14 PM

see first responce on

http://graphsharp.codeplex.com/Thread/View.aspx?ThreadId=224074

 

not certain on the 2nd one - try:

1) ensure that you've defined a proper equality method on your edge class

2) does the code work if you store a reference to the edge that you want to remove instead of creating two identical classes?

let us know what works

Dec 14, 2010 at 5:18 PM

hi guys,

1.i need to create undirected graph and display itbut it doesn't work!

2.i cannt create undirected graph then i used bidircted like this to add a edge:

graph.AddEdge(new Edge<string>(FirstVertexTextBox.Text, SecondVertexTextBox.Text));

graph.AddEdge(new Edge<string>(SecondVertexTextBox.Text, FirstVertexTextBox.Text));

but i cannt remove added edge:

graph.RemoveEdge(new Edge<string>(FirstVertexTextBox.Text, SecondVertexTextBox.Text));  

graph.RemoveEdge(new Edge<string>(SecondVertexTextBox.Text, FirstVertexTextBox.Text));

my second is worng because i should use undirected but i dont have any other choice thefore i use bidirceted, if i can add undirected graph i dont need have the second problm, what should i do??

Dec 14, 2010 at 10:32 PM

i solved remove edge by this:

IEdge<string> edge;

_Graph.TryGetEdge(SecondVertexTextBox.Text, FirstVertexTextBox.Text,out edge);

_Graph.RemoveEdge(edge);

_Graph.TryGetEdge(FirstVertexTextBox.Text, SecondVertexTextBox.Text,out edge);

_Graph.RemoveEdge(edge);