I'm not a mathematician, but I am pretty sure you can go by a rough order of magnitude scale... If you have gross headings that are many orders of magnitude larger than others, your best bet is to look in those large ones for waste first. Scientific research would have to be eliminated tens or hundreds of times over to get to a level of savings that could probably be removed easier from waste in headings like defense and law enforcement and corporate subsidy.
Mathematically, sure. Math isn't the problem in politics, territory is. All the little things add to people's territory and patronage. It also keeps people from making the big cuts. We need a culture change to spend the money responsibly and it will only happen when "it's only a couple of million" is removed from our vocabulary.
As an aside in 2011, Defense and international security assistance is 20% of the budget. Social Security spending was higher than that (731 vs 718 billion). Medicare, Medicaid, and CHIP was a bit bigger at $769 billion. The rest of the safety net style programs was $466 billion. $230 billion was spent paying interest on the national debt.