2010-09-29, 03:08 AM
I came up with a way that's a lot more simple, but it runs in O(n^n) time. With a few optimizations, you could get it to run in O(log n^n) time, but the amount of iterations you'd need is unreal. Russt's would run far faster, but it is more complicated.
This should define it enough for you. I thought this up while thinking about databases - many men, many women, many likes. How would that be stored in a database? A junction table, of course!
This should define it enough for you. I thought this up while thinking about databases - many men, many women, many likes. How would that be stored in a database? A junction table, of course!
Code:
struct Compatibility
{
int manID;
int womanID;
int manLike;
int womanLike;
struct Compatibility *next;
}