I've tried to make a meal planner that used linear programming to ensure that I got all of the needed nutrients and minimized calories, but it didn't work out. It really liked to suggest moose meat and some insanely healthful fruit from Argentina. It also suggested I drink 642 cups of coffee a day, I guess because coffee has some trace amount of whatever nutrient everything else lacked.
It was also difficult to figure out exactly how much of each nutrient I needed. There is no one list that has all of the nutrients, and different lists that cover different nutrients suggest different amounts of the nutrients that intersect the lists.