# How to reuse vertex names using the tkz-berge graph drawing package?

I'm trying to draw a graph using tkz-berge, where many of the vertices might display the same value, is there a way I can do this?

Here is my code:

\begin{figure}[h]
\centering
\begin{tikzpicture}[scale=0.75,transform shape]
\tikzstyle{LabelStyle}=[fill=white,sloped]
\Vertex[x=0,y=0]{A}
\Vertex[x=-2,y=-1]{B}
\Vertex[x=2,y=-1]{C}
\tikzstyle{EdgeStyle}=[post]
\Edge[](A)(B)
\Edge[](A)(C)
\end{tikzpicture}
\caption{\label{fig:typical}Cool graph}
\end{figure}


But instead of B<-A->C (is what this graph looks like), I'd like it to be, for example, something like B<-A->B. So basically I guess what I'm asking is, can I have the name of the vertex in the code be different from what is actually displayed on the screen (like a "label")?

P.S. I don't have enough reputation to create the tag 'tkz-berge', but there is a 'tkz-graph' tag. I can't tell if that package is different or an alternate name of berge, but it seems to be very similar, so tagging as that.

Use the L= option for \Vertex to have a different label:

\documentclass{article}
\usepackage{tkz-berge}
\usepackage{lipsum}

\begin{document}

\begin{figure}
\centering
\begin{tikzpicture}[scale=0.75,transform shape]
\tikzstyle{LabelStyle}=[fill=white,sloped]
\Vertex[x=0,y=0]{A}
\Vertex[x=-2,y=-1]{B}
\Vertex[x=2,y=-1,L=B]{C}
\tikzstyle{EdgeStyle}=[post]
\Edge[](A)(B)
\Edge[](A)(C)
\end{tikzpicture}
\caption{\label{fig:typical}Cool graph}
\end{figure}

\end{document}


As a side note, don't use the too restrictive placement specifier [h].

• That's exactly what I was looking for! Will look into the [h] as well, thanks. – mindthief Oct 23 '12 at 1:47