C
C#6mo 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
Omnissiah
Omnissiah6mo 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
doomcenturyOP6mo 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
Omnissiah
Omnissiah6mo ago
'today' is a pretty short term
doomcentury
doomcenturyOP6mo ago
Lets say I want to finish this in 9 hours
doomcentury
doomcenturyOP6mo 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
doomcenturyOP6mo 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
Pobiega6mo ago
you only check that ONE of them is not null
doomcentury
doomcenturyOP6mo ago
And they can't be anything else than correct type or null
Pobiega
Pobiega6mo ago
x != null || y != null
doomcentury
doomcenturyOP6mo ago
Same error btw
No description
Pobiega
Pobiega6mo ago
if x is not null, or y is not null, do the following...
doomcentury
doomcenturyOP6mo ago
Even with &&
Pobiega
Pobiega6mo ago
set a breakpoint and inspect the values when it breaks
doomcentury
doomcenturyOP6mo ago
sure I mean the mypoint is null Then I added a check if mypoint is null or not Completely ignored Still errors
Pobiega
Pobiega6mo ago
the fact that your list contains a null seems like an error in itself if you ask me
doomcentury
doomcenturyOP6mo ago
i honestly dont even know what I'm doing atp yet i need to fix this
Pobiega
Pobiega6mo 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
doomcenturyOP6mo 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
Pobiega6mo ago
that seems unlikely, considering you are getting it in an iterator
doomcentury
doomcenturyOP6mo 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
Omnissiah
Omnissiah6mo ago
good luck
doomcentury
doomcenturyOP6mo 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
Omnissiah
Omnissiah6mo ago
i don't know is it really deleted or are you redrawing the entire content
doomcentury
doomcenturyOP6mo ago
I always redraw everything because I have an option to delete points
doomcentury
doomcenturyOP6mo ago
fixed
No description
doomcentury
doomcenturyOP6mo 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
doomcenturyOP6mo ago
No description
No description
No description
doomcentury
doomcenturyOP6mo ago
I'm in shambles rn @WEIRD FLEX
doomcentury
doomcenturyOP6mo ago
The table
No description
Omnissiah
Omnissiah6mo 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