• Post Reply Bookmark Topic Watch Topic
  • New Topic

Coding forward checking to paint all state of Australia with three different colors  RSS feed

 
Antoine Compagnie
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there!

I want to code a forwardchecking algorithm in java...
I already have a parser class with a main that creates the variables, binary constraints, ...

I'm now coding the algorithm that deals with all that stuff and I'm stuck. I don't know how to assign variables and check the constraints before going further.

I'm tring to colour eahc state of Australia with one colour. No surrounding state of a given state should have the same colours.

here is the algorithm code :



And here is the class that creates  the variables, binary constraints, ...



Can you help me having a good start?

Here is a reminder of the algorithm :

 
Carey Brown
Saloon Keeper
Posts: 3329
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's a lot of info missing. I would improve greatly if using descriptive names for things using camel-case.
  • What's a 'CSP'?
  • What's a "Variable'?
  • What's a 'D'?
  • What's a "Node"?
  • What's a BinaryConstraint?
  • What's the contents of the ".txt" file(s)?
  • Where is the list of edges stored?
  • Where is the list of vertices stored? Or are these being converted to Nodes as they're being read?
  • Can you rephrase the algorithm in English pseudo code?

  • I don't think you are getting any responses because it's impossible (very difficult?) to follow what you've provided.
    Ideally, you should provide all the information necessary for someone helping you to build, run, and understand your question.
     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!