Military usage of scientific work I'm currently writing my diploma thesis (old equivalent of master in Germany) in mathematics. It's about a fairly new combinatorical optimization problem which has military applications. In fact, the problem originates from that, even though in the formulation I'm studying it is a bit more theoretical.

I got this topic without the knowledge of its applications and of course I don't like optimizing the ways of killing people. (Just to clarify: luckily there are other (good) applications too)

It is likely that my research will end up in a paper, thus beeing widely available. Is it possible to restrict usage of such research to non-military applications only?

(side note: Probably no military organization will ever comply with such a restriction. I'm aware of that.)
I don't think you have any right to restrict the usage of your publications. You might retain the original copyright (or your publisher will), and thus prevent that anyone else (including the army) can publish your work on their behalf, but you can't prevent someone to use your idea just because it's published. 

A legal possibility could be to file a patent protecting your approach, but I'm not sure if it covers all usage or only commercial usages (in which case the army could use it as long as they are not making money out of it). You might want to check this with AskPatent. 

You could also not publish it, and it could be possible to ask your university to consider your thesis as confidential (I've seen some cases where a thesis was confidential, when some companies were involved in them), but your advisor might not agree.