# Has this algorithm been written yet?

Page 1 of 1

## 7 Replies - 531 Views - Last Post: 07 December 2017 - 08:41 AM

### #1 bobsmith76

Reputation: 9
• Posts: 159
• Joined: 14-February 17

# Has this algorithm been written yet?

Posted 05 December 2017 - 06:00 AM

What I need to do in the above is I need to loop through the lists. Think of the numbers as hypotheses. If the list has only one member then you just go to the next list. If the list has several members then you just assume the first member is what works. No number can appear in two lists. As you loop through the list each time you will test whether the hypothesis works. If your hypothesis fails then you need go back to the first point in which the tree diverges and choose a new member. Ultimately, only one number will fit in each slot.
I prefer a pythonic solution but maybe this puzzle has a name and it has been dealt with in other languages.

I'm pretty sure that the tree will be too big to calculate with so I am already working on another way to trim the tree down. I have other variables in the algorithm which might help.

Plus is there a better way to post images? Or is it because I only have 53 posts and cannot be trusted to post images.

This post has been edited by modi123_1: 05 December 2017 - 06:29 AM
Reason for edit:: Added img tags.

Is This A Good Question/Topic? 0

## Replies To: Has this algorithm been written yet?

### #2 modi123_1

• Suitor #2

Reputation: 13953
• Posts: 55,693
• Joined: 12-June 08

## Re: Has this algorithm been written yet?

Posted 05 December 2017 - 06:33 AM

Is this 'forward chaining' as in you are making an 'inference engine'?
https://en.wikipedia...orward_chaining
https://en.wikipedia...nference_engine

No.. use imgur to host your image and use the image tag to display it.

### #3 bobsmith76

Reputation: 9
• Posts: 159
• Joined: 14-February 17

## Re: Has this algorithm been written yet?

Posted 05 December 2017 - 06:36 AM

Actually, it might be the case that there are 16 billion possibilities and only one right one, so I am certainly going to look for a different solution. I think I already have one.

bobsmith76, on 05 December 2017 - 06:34 AM, said:

Actually, it might be the case that there are 16 billion possibilities and only one right one, so I am certainly going to look for a different solution. I think I already have one.

It is an inference engine but I don't thinks it's forward chaining. I'm very tired right now so I'll go into more details tomorrow.

### #4 modi123_1

• Suitor #2

Reputation: 13953
• Posts: 55,693
• Joined: 12-June 08

## Re: Has this algorithm been written yet?

Posted 05 December 2017 - 06:39 AM

There's always backwards chaining.
https://en.wikipedia...ckward_chaining

### #5 bobsmith76

Reputation: 9
• Posts: 159
• Joined: 14-February 17

## Re: Has this algorithm been written yet?

Posted 05 December 2017 - 06:45 AM

modi123_1, on 05 December 2017 - 06:39 AM, said:

There's always backwards chaining.
https://en.wikipedia...ckward_chaining

Actually, I'm going to try a completely different solution. It's about matching sentences and I already have the sentences numbered in a heirarchy.

### #6 modi123_1

• Suitor #2

Reputation: 13953
• Posts: 55,693
• Joined: 12-June 08

## Re: Has this algorithm been written yet?

Posted 05 December 2017 - 06:46 AM

Matching sentences? Seems odd when most folk look at the parts that make up a sentence to get the idea of the whole.

So it goes.. it's your project... there's also LISP to use for fuzzy logic. I remember that helping out some.

I have to say this has a large leibniz76 vibe to it.

### #7 Skydiver

• Code herder

Reputation: 6110
• Posts: 21,025
• Joined: 05-May 12

## Re: Has this algorithm been written yet?

Posted 06 December 2017 - 04:35 PM

In the OP, there is mention of a "tree". Perhaps it's just because it's been a long day, or maybe I am just dense, but I'm not seeing how a tree is constructed with that data.

### #8 macosxnerd101

• Games, Graphs, and Auctions

Reputation: 12271
• Posts: 45,363
• Joined: 27-December 08

## Re: Has this algorithm been written yet?

Posted 07 December 2017 - 08:41 AM

At first glance, the image in the OP looks like an adjacency list representation of a graph. Since this project is about language recognition, are you describing a context-free grammar of some sort?