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.
30 Replies
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
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
'today' is a pretty short term
Lets say I want to finish this in 9 hours
@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
this line errors :
even though I check that these values are not null
you only check that ONE of them is not null
And they can't be anything else than correct type or null
x != null || y != null
Same error btw
if x is not null, or y is not null, do the following...
Even with &&
set a breakpoint and inspect the values when it breaks
sure
I mean the mypoint is null
Then I added a check if mypoint is null or not
Completely ignored
Still errors
the fact that your list contains a null seems like an error in itself if you ask me
i honestly dont even know what I'm doing atp
yet i need to fix this
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
Ok I fixed it
Took a different approach
It could be very well condition racing
As it seems mypoint changed AFTER the if statement
that seems unlikely, considering you are getting it in an iterator
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
good luck
@WEIRD FLEX @Pobiega Any reason why my line gets removed once I make a new one?
https://gyazo.com/7635142d7e4b91e51cfcf94ebfcbd427
Gyazo
Gyazo Screen Video
i don't know is it really deleted or are you redrawing the entire content
I always redraw everything because I have an option to delete points
fixed
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
I'm in shambles rn
@WEIRD FLEX
The table
don't declare a new random in the method
it should an object used application-wise
you could use the shared random eventually