A professor has only proofread my paper. Should I include him as author?
I would thank him in the acknowledgments. Although there is no set standard for what is required to be an author, it is generally accepted that they must make a research contribution. Proofreading definitely doesn't meet that criterion (or any of the other criteria that I have seen).
I did this in one of my recent papers. I just said:
We would also like to thank Bob Bob for his helpful feedback on a draft of the paper.
The answer below assumes that the professor (P) is the advisor of the student (S), and that the internal guidelines of the institution forbid P to be a coauthor unless his/her contribution is sufficiently large. (Consider other answers for all other cases.)
This was the case for one of institutions I've been to. For such institutions, the unspoken, unwritten, but still present culture of deciding upon such an issue at my institution goes roughly along the following lines. It is similar for many other institutions (and it may or may not be like this in your case).
S: Here is the current paper draft to be sent to the conference XXX. As of now, you are in the acknowledgements. Would you like to be a second author?
P: No, thanks, please do not make me a coauthor.
S: Are you sure? You really contributed a lot of proofreading to it.
P: No, that's ok. The paper contains only your ideas.
S: But you are also my advisor, so I think you should be on it.
P: No, you did all the hard work. You should be the single author.
S: Ok, thank you. Then your name will be in the acknowledgements / in a footnote on the first page / etc. But, still, you did proofreading. Is there anything I could do in return?
P: ...
If you tend to think that your institution has similar rules and culture, consider simply trying out this approach. Do not include your advisor iff he/she rejects at least, say, thrice. Otherwise, do inlcude him/her.
As you already mentioned it, you have a really pratical option to handle your conflict. The acknowledgement section in which you can also wrap authors's contribution in most journals. In case you decide to offer him the co-authorship you can and should put all author's contribution as they have happened. Your own case is pretty clear here. AB contributed by developing and implementing the algorithm as well as writing the complete draft.
I would like to give you the following points you might have missed considering yet regarding other co-authors, especially your professor's one:
Is your professor the project leader? You could acknowledge his contribution by stating this, but also you could consider granting him co-authorship. Is this a collaborative project which you are provided with initially? Your professor most likely has spent a lot of years operating in his position within the science field to have the capability to do so. He can be protecting you from an overwehlming administrative amount of work (which is needed for the existense of positions like yours). Without him there would be no workstation, no access to a free cluster to perform heavy computations?
For me this are ethical reasons (or others like this examplary given exists behind the scenes) to grant a co-authorship if clarified with something like "Prof. XY's contribution gets acknowledged with leadership of project XZ funded under nummer 111 by YZ" All co-authors in addition contributed by an internal review. "All co-authors" needs to be addapted in your considered two-author case.
Take some weeks to consider these points in case you never done this before. Talk to your collagues about it. Also to some long term post-docs. Those can help you seeing stuff faster which now might still be hidden to you. I also would like to emphasize. You never put just someone as a co-author, you offer him co-authorship. It is a much more respectful way to describe this procedere because this forumlation still implies the possibility that your professor rejects because he consideres his time he is able to spent not worthy to accept.
Finally, I just gave you my point of view, but I cannot give you a direct answer. Consider such points and also the arguments from a contradictionary point of view which might show up in another answer. It will still be your decision which you have to do by yourself.
There is authors guidelines in every journal which you should read carefully and follow. I have not done this in your field (the reading of the guidelines). I know though some papers of computer science and those have a (for my field) rather uncommon high frequency of really small teams or single authors. So the ethical common sense might be shifted a bit from my pov. My main point was that I see no ethical conflict if the pure secondary nature of contribution is stated clearly (but ofc in agreement with the journal).