To write peer-reviewed journal articles and get them published is probabally the hardest and most important part of graduate school life. An “algorithm” for writing a paper was proposed by Professor Pete Carr in a youtube video titled “How to write a paper in a weekend” . (What an attractive and exciting title!)
The outline of the algorithm extracted from the video is presented as the following:
An old saying attributed to Sir Francis Bacon from his essay “Of Studies” was quoted in the video to stress the importance of writing.

Reading maketh a full man; conference a ready man; and writing an exact man.
The algorithm above is not only informative but also clear and easy to follow.