resource-allocation-graph.tex 957 B

1234567891011121314151617181920212223242526272829
  1. \documentclass{article}
  2. \usepackage[pdftex,active,tightpage]{preview}
  3. \setlength\PreviewBorder{2mm}
  4. \usepackage{tikz}
  5. \usetikzlibrary{arrows,positioning, calc,lindenmayersystems,decorations.pathmorphing,intersections}
  6. \tikzstyle{resource}= [draw,minimum size=16pt,inner sep=0pt]
  7. \tikzstyle{process} = [draw,minimum size=16pt,inner sep=0pt,circle]
  8. \tikzstyle{allocation} = [->,thick,arrows={-latex}]
  9. \begin{document}
  10. \begin{preview}
  11. \begin{tikzpicture}[scale=2]
  12. \node (r1)[resource] at (0,2) {$R_1$};
  13. \node (r2)[resource] at (1,2) {$R_2$};
  14. \node (r3)[resource] at (2,2) {$R_3$};
  15. \node (p1)[process] at (0,1) {$P_1$};
  16. \node (p2)[process] at (1,1) {$P_2$};
  17. \node (p3)[process] at (2,1) {$P_3$};
  18. \node (r4)[resource] at (0,0) {$R_4$};
  19. \draw[allocation] (r1) -- (p1);
  20. \draw[allocation] (r2) -- (p2);
  21. \draw[allocation] (r3) -- (p2);
  22. \draw[allocation] (p3) -- (r3);
  23. \end{tikzpicture}
  24. \end{preview}
  25. \end{document}