2
$\begingroup$

I'm writing a technical paper and the review committee wants my methodology to be represented in a conventional algorithm format.

I've been searching all over the web for the conventional structure of an algorithm with little luck. Can someone tell me the conventional format of an algorithm or any specification from IEEE for writing algorithms?

$\endgroup$
  • $\begingroup$ "Conventional algorithm format" means "the conventional format for algorithms", not "the format for conventional algorithms." $\endgroup$ – David Richerby Dec 5 '14 at 10:42
  • $\begingroup$ This question appears to be off-topic because it based solely on a misunderstanding of typesetting instructions. $\endgroup$ – David Richerby Dec 5 '14 at 10:43
  • 1
    $\begingroup$ @DavidRicherby I'm not sure which translation caused this. It seems to me the OP wants to know how to write down algorithms, which is a valid question. $\endgroup$ – Raphael Dec 5 '14 at 12:39
  • $\begingroup$ @Raphael If that is indeed the question, I'm happy to retract my close vote. But the current phrasing makes it look very much like the question is "What is a 'conventional algorithm'?" and one of the answers starts by addressing that. prince, could you please clarify? $\endgroup$ – David Richerby Dec 5 '14 at 13:44
7
$\begingroup$

There is no such thing as the "format" for algorithms. A general agreement¹ is to use pseudocode, i.e. code that abstracts from the particulars of specific programming languages, machines and/or libraries.

The most important thing is to be consistent. If you want to follow a specific style, I recommend you pick up some textbooks on algorithms and/or data structures and follow the style you like best.

Some kinds of pseudocode have specific package support in LaTeX, e.g. clrscode, algorithms or pseudocode. For help with these go to tex.SE.


  1. As long as you publish about algorithms as scientist. Articles featuring concrete technology frequently use real code, for better or worse.
$\endgroup$
  • $\begingroup$ Pseudo code can use mathemathical notation to express computations that are straightforward in the context considered. It does not have necessarily into details, nor have to give the definition of subprograms, when the name of the subprograms is enough to understand what they are doing and how they do it. $\endgroup$ – babou Dec 5 '14 at 15:28
  • 1
    $\begingroup$ @babou I think that's best summarised by "source code is for machines, pseudo code for humans". $\endgroup$ – Raphael Dec 5 '14 at 15:51
3
$\begingroup$

A quick google search will tell you what an algorithm is.

Now for "convential algorithm format" I think it would be helpful to look at how to write pseudocode.

From wikipedia: "Pseudocode is an informal high-level description of the operating principle of a computer program or other algorithm."

It is useful to express ideas and main concepts behind an algorithm without relying on implementation details and is used in almost any paper discussing implementation.

Even though people aim to write pseucode anyone with any programming background can read, there are some general guidelines. One example could be this

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.