C
C#7mo ago
doomcentury

Graph Coloring help

Hello, I am new to coding in C# and new to WinForms. I am trying to make graph coloring with an option to select one of two algorithms: greedy and backtrack. I would appreciate it if someone dedicated their time in helping writing this program. 1. I need to be able to edit/delete points I've already drawn. 2. I need to connect the points I've drawn 3. I need to make these algorithms work with my interface 4. I need to be able to save generated graph.
No description
30 Replies
HtmlCompiler
HtmlCompiler7mo ago
i did something like this when i was a kid, although mine had slightly different objectives anyway if you put this stuff on github/gitlab/ecc people can contribute if that's what you are asking
doomcentury
doomcenturyOP7mo ago
I want to finish this program today tho And I'm kinda overwhelmed and don't know how to do the rest Just looking for a person who can dedicate a hour or two in dms to help me finish this program
HtmlCompiler
HtmlCompiler7mo ago
'today' is a pretty short term
doomcentury
doomcenturyOP7mo ago
Lets say I want to finish this in 9 hours
doomcentury
doomcenturyOP7mo ago
@WEIRD FLEX Yo, I have a problem when trying to remove rectangle, any idea why? 1. Error window 2. Paint method 3. Rectangle deletion 4. Rectangle creation (Delete method shown) 5. Dispose methods
No description
No description
No description
No description
No description
doomcentury
doomcenturyOP7mo ago
this line errors :
e.Graphics.DrawEllipse(mypoint.DrawingPen, mypoint.Dot);
e.Graphics.DrawEllipse(mypoint.DrawingPen, mypoint.Dot);
even though I check that these values are not null
Pobiega
Pobiega7mo ago
you only check that ONE of them is not null
doomcentury
doomcenturyOP7mo ago
And they can't be anything else than correct type or null
Pobiega
Pobiega7mo ago
x != null || y != null
doomcentury
doomcenturyOP7mo ago
Same error btw
No description
Pobiega
Pobiega7mo ago
if x is not null, or y is not null, do the following...
doomcentury
doomcenturyOP7mo ago
Even with &&
Pobiega
Pobiega7mo ago
set a breakpoint and inspect the values when it breaks
doomcentury
doomcenturyOP7mo ago
sure I mean the mypoint is null Then I added a check if mypoint is null or not Completely ignored Still errors
Pobiega
Pobiega7mo ago
the fact that your list contains a null seems like an error in itself if you ask me
doomcentury
doomcenturyOP7mo ago
i honestly dont even know what I'm doing atp yet i need to fix this
Pobiega
Pobiega7mo ago
then take a step back and re-focus you are clearly passing something incorrect to the DrawEllipse method, as per the stacktrace. I would enable break on exceptions and run the program in debug
doomcentury
doomcenturyOP7mo ago
Ok I fixed it Took a different approach It could be very well condition racing As it seems mypoint changed AFTER the if statement
Pobiega
Pobiega7mo ago
that seems unlikely, considering you are getting it in an iterator
doomcentury
doomcenturyOP7mo ago
so I just added a bool variable in point, and if it's true, the paint method removes the point Now time to add point editing ok added editing time to somehow implement graph coloring
HtmlCompiler
HtmlCompiler7mo ago
good luck
doomcentury
doomcenturyOP7mo ago
@WEIRD FLEX @Pobiega Any reason why my line gets removed once I make a new one? https://gyazo.com/7635142d7e4b91e51cfcf94ebfcbd427
No description
No description
No description
HtmlCompiler
HtmlCompiler7mo ago
i don't know is it really deleted or are you redrawing the entire content
doomcentury
doomcenturyOP7mo ago
I always redraw everything because I have an option to delete points
doomcentury
doomcenturyOP7mo ago
fixed
No description
doomcentury
doomcenturyOP7mo ago
made the same class for lines as for points @Pobiega You have some free time? My algorithms for some reason recolor everything in the same color
doomcentury
doomcenturyOP7mo ago
No description
No description
No description
doomcentury
doomcenturyOP7mo ago
I'm in shambles rn @WEIRD FLEX
doomcentury
doomcenturyOP7mo ago
The table
No description
HtmlCompiler
HtmlCompiler7mo ago
don't declare a new random in the method it should an object used application-wise you could use the shared random eventually
Want results from more Discord servers?
Add your server