|
|
|
|
|
by segmondy
2783 days ago
|
|
This type of things is based solved with Prolog. The issue is that folks are trying to solve declarative problems using procedural/object oriented/functional programming. Because we store data in databases, we have twisted it into a database problem but it's not. book(Room, Rate):-
availableBuildings(Buildings),
availableRooms(Buildings, Rooms),
rate_less_than(Rate, Rooms)
cheapest(Rooms, Room).
However complex you think this problem is, it's pretty simple. It's a very old problem, scheduling, well understood and solved. Using the wrong tool makes it a nightmare. Using the right tool makes it ridiculously easy. The solution is not the database, but the language. |
|