Document Classestikz + foreach question

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
XHelp
Posts: 1
Joined: Thu Nov 06, 2008 12:28 am

tikz + foreach question

Post by XHelp »

Hello!
First at all: sory my bad english

i use latex beamer to make a presentation.
i draw with tikz and foreach one graph:

Code: Select all

\foreach \pos/\name in {{(0,2)/S2}, {(0,4)/S1}, {(4,3)/A}}
\node (\name) at \pos [] {$\name$};

\foreach \source/ \dest /\weight in {S1/A/5, S2/A/8}
\draw[->] (\source) to node[] {\weight} (\dest);
Now i need to change, also with foreach, the weight (and color) of the edges.
finaly i will to get similary result as the attached pdf, but for each path from s to t.
Can anybody help me with it?
Thanks!
Attachments
test.pdf
example
(47.17 KiB) Downloaded 297 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

propell
Posts: 44
Joined: Fri May 30, 2008 11:16 am

Re: tikz + foreach question

Post by propell »

I don't have any clear answers to your question. The example in the following link is related and may give you some hints on how to solve your problem:

http://www.texample.net/tikz/examples/prims-algorithm/



- Kjell Magne Fauske
Post Reply