Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8564355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:10:53+00:00 2026-06-11T17:10:53+00:00

Sorry if i posted this here wrong. But i sort of did not know

  • 0

Sorry if i posted this here wrong. But i sort of did not know which Stackoverflow channel should i post this and thought this is the best.

I am solving a KenKen Puzzle. It is very similar to sudoku and have some cages with a total sum and operator and we have to solve filling boxes using unique numbers.

To solve the puzzle, i would be having an input where i can get values for each cage, such as total value of the cage, operator to be used ad boxes involved.

As per my approach for solving the problem using backtracking:

  1. I am parsing the input to create a class data structure for each cage.
  2. Later i am creating an array of class objects for each cage.

  3. Thereafter i would apply my algorithm using backtracking to solve this puzzle.

Before i start coding i just wanted to discuss with folks here, if they do think the programming approach is right or do i still need to make changes to the approach or if they would like to suggest me something to solve.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T17:10:55+00:00Added an answer on June 11, 2026 at 5:10 pm

    I think backtracking is the probably one of the best ways to solve this problem.
    Honestly I cannot figure out something better at the moment.

    I don’t know what exactly you are planning to do in your algorithm.
    But I suggest you should not only rely on the backtracking itself. I only read the article on wikipedia to know what KenKen is. But it seems as if it would be possible to improve the backtracking from beginning:

    For backtracking you usually use a stack. So you probably have a stack with objects which tell you which number you put in which cage.
    Now you could give each of this stack objects a property which tells if your algorithm just chose this number from a bunch of possibilities or if your algorithm was forced to chose this number at this place because it had no other choice.
    So instead of such a stack:

    (2,2) 5
    (1,1) 4
    (0,0) 1
    

    Your stack would look like this:

    (2,2) 5 CHOSEN
    (1,1) 4 IMPLIED
    (0,0) 1 CHOSEN
    

    And then you have to backtrack only to the last “IMPLIED”, because you cannot chose some other value here. Also, something would be IMPLIED if all other choices turned out to be wrong.
    I don’t know how far this is possible in a KenKen. You should make sure, that a choice in the beginning cannot force your algorithm later to use IMPLIED although the number actually is not IMPLIED at this place.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I didn't know if this should be posted here or on Programmers - Sorry.
Sorry, I know this question is easy, but I don't know how to get
(Note - this is a re-post as my first question got posted under wrong
Sorry if something similar has been posted here already, but I couldn't really find
Sorry, for double posting, already posted this question once, but I realized I weren't
Sorry if this has already been posted, but I have seen many of them
First of all, I'm not entirely sure if this fits into stackoverflow, or should
Sorry guys, I posted this earlier today where my add as linked images were
im sorry if this was posted already i have been looking to no avail..
First I am sorry if I posted at the wrong place. Now onto the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.