Algorithm for selecting a breed of pets / cars / bicycles / etc from a database based on user responses

This quesiton is more about getting the point in the right direction. I inherited and developed a project to create a car selection database (matching user preferences). It already works relatively well, but it could be better (there are a few questions), so I would like to explore some other algorithms used by others. The site I'm working on uses a best-fit algorithm where each car is assigned a "1" every time it matches a quesiton and they are added together.

I like in particular the following site (for selecting dog breeds):

Can anyone point me in the right direction where I can find something like this (I searched, but probably didn't look in the right places or use the correct search terms)? I would like to be able to view and study the algorithm used (PHP / mySQL).

The (incomplete) site I'm working on:

Any help would be much appreciated. Thank.


source to share

1 answer

This is just like any other dropdown filter, except that it is implemented in a wizard-like manner. You should have some class in your session with more or less structure like this:

public class CarSearchWizard
    public int Passengiers = 0;
    public int DrivingFor = 0;


I didn't notice that your search depends on the previous selection, so it's pretty simple - filter for number of people, driving, etc. at each iteration of the user search. I think your algorithm is fine, except that it is quite lengthy :)



All Articles