Jump to content

File:Some types of control flow graphs.svg

Page contents not supported in other languages.
This is a file from the Wikimedia Commons
From Wikipedia, the free encyclopedia

Original file (SVG file, nominally 270 × 491 pixels, file size: 9 KB)

Summary

Description
English: Some examples of control flow graphs (CFG):

(a) the CFG of a if-then-else (b) a while loop (c) a natural loop with two exits, e.g. while with an if...break in the middle; non-structured by reducible (d) an irreducible CFG: a loop with to entry points, e.g. goto into a while loop

Source code in DOT, svg generated with graphviz:

digraph CFG_examples {
  node [shape=circle width=0.3 height=0.3 label="" fixedsize=true]
  edge [arrowsize=0.5]
  if -> { then; else } -> fi
  while -> body [weight=3]
  body -> while:w
  while -> end
  body -> end [style="invis" weight=3]
  fi -> exit1 [style="invis"]
  exit1 -> exit2
  exit2 -> body2 [weight=4]
  body2 -> exit1:w
  exit1 -> out:e
  exit2 -> out
  body2 -> out [style="invis" weight=4]
  end -> top [style="invis"]
  top -> entry1 [weight=2]
  entry1 -> out2
  top -> entry2:w 
  entry1 -> entry2 [weight=4]
  entry2 -> entry1:w
  entry2 -> out2 [style="invis" weight=4]
  if [xlabel = "(a)"]
  while [xlabel = "(b)"]
  exit1 [xlabel = "(c)"]
  top [xlabel = "(d)"]
} /*end digraph*/
Date
Source Own work
Author JMP EAX

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

27 July 2014

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current06:57, 27 July 2014Thumbnail for version as of 06:57, 27 July 2014270 × 491 (9 KB)JMP EAXUser created page with UploadWizard

The following page uses this file:

Global file usage

The following other wikis use this file:

Metadata