A
A
avenu2014-08-12 17:09:29
Algorithms
avenu, 2014-08-12 17:09:29

How to sort an array of data following fuzzy logic?

Interested in the following question. Are there, and what are the names of, algorithms that could give an object containing variables with numbers its weight in comparison with other objects, and the logic of such a comparison is subjectively given by a person?
For example, there is a fruit object, with data on how sweet it is and how healthy it is in some units. Suppose it is about twice as important for me that it is sweet than healthy. How then to sort the array so that this information is reflected in it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2014-08-12
@avenu

weight coefficients and sum. Sort by this amount.

T
tsarevfs, 2014-08-12
@tsarevfs

In order to sort an array, you need to be able to compare them for more / less for any pair of objects (fruits in your example). Almost all popular programming languages ​​have the ability to sort with a custom comparison function. In what language do you want to implement it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question