How to change the text placement on edge Tikz

Consider the following code:

begin{tikzpicture}[
node distance = 35mm,
vertex/.style = {circle, draw, text width=4.4em, align=center},
every edge/.style = {-Straight Barb, draw, semithick}
]
%
node (B) [vertex]  {Facility $B$};
node (C) [vertex, right=of B]  {Facility $C$};
node (A) [vertex, above=of $(B.north)!0.5!(C.north)$] {Facility $A$};
%
draw (A) edge [bend right,"$p_{AB}$"] (B);
draw (B) edge [bend right,"$p_{BA}$"] (A);
%
draw (A) edge [bend left,"$p_{AC}$"] (C);
draw (C) edge [bend left,"$p_{CA}$"] (A);
draw (C) edge [bend left,"$p_{CB}$"] (B);
%
draw[transform canvas={yshift=+1ex}]  (B) edge ["$p_{BC}$"]  (C);
end{tikzpicture}

Which produces: Here is what I want to achieve:

• Make the placement of P_AB as that of P_AC.
• Make the placement of P_CA as that of P_BA.
• Prevent the edges BA and CA from crossing each other.
• The subscripts AB, BA, CA, etc. do not really appear to be subscripts. They appear to be on the same line as p. Is there a way to emphasize their subscript-ness, if you may?
• What is the easiest and most straightforward way of scaling this picture (with all its contents) up or down?

TeX - LaTeX Asked by Aziz on December 31, 2020

Instruction swap or its shortness ' push edge label on opposite edge side.

Edit: Now are considered all sub questions ... documentclass[tikz, margin=3.14159mm]{standalone}
usetikzlibrary{arrows.meta,
calc,
positioning,
quotes}

begin{document}
begin{tikzpicture}[
node distance = 35mm,
vertex/.style = {circle, draw, text width=3.2em, align=center},
every edge/.style = {-Straight Barb, draw, semithick},
bend angle=15 % <---
]
%
node (B) [vertex]  {Facility $B$};
node (C) [vertex, right=of B]  {Facility $C$};
node (A) [vertex, above=of $(B.north)!0.5!(C.north)$] {Facility $A$};
%
draw   (A) edge [bend right,"$p^{}_{AB}$" ']  (B)
(B) edge [bend right,"$p^{}_{BA}$"]    (A)
%
(A) edge [bend left,"$p^{}_{AC}$"]     (C)
(C) edge [bend left,"$p^{}_{CA}$" ']   (A)
(C) edge [bend left,"$p^{}_{CB}$"]     (B)
%
(B) edge [bend left,"$p^{}_{BC}$"]  (C); % <---
end{tikzpicture}
end{document}

Correct answer by Zarko on December 31, 2020 documentclass[a4paper]{report}
usepackage{amsmath}
%usepackage
usepackage{tikz}
usetikzlibrary{math, positioning, calc, arrows.meta, decorations.markings,quotes}
begin{document}

begin{tikzpicture}[
node distance = 35mm,
vertex/.style = {circle, draw, text width=4.4em, align=center},
every edge/.style = {-Straight Barb, draw, semithick}
]
%
node (B) [vertex]  {Facility $B$};
node (C) [vertex, right=of B]  {Facility $C$};
node (A) [vertex, above=of $(B.north)!0.5!(C.north)$] {Facility $A$};
%
draw (A) edge [bend right,"$text{p}_text{AB}$" '] (B);
draw (B.north east) edge [out=45,in=255,looseness=1.2,"$text{p}_text{BA}$"] (A);
%
draw (A) edge [bend left,"$text{p}_text{AC}$"] (C);
draw (C.north west) edge [out=135,in=-75,looseness=1.2,"$text{p}_text{CA}$" '] (A);
draw (C) edge [bend left,"$text{p}_text{CB}$"] (B);
%
draw[transform canvas={yshift=+1ex}]  (B) edge ["$text{p}_text{BC}$"]  (C);
end{tikzpicture}

end{document}

Answered by js bibra on December 31, 2020

Related Questions

How to make a dotted arrow in a commutative diagram?

2  Asked on April 16, 2021

Background in Beamer with Tikz

0  Asked on April 16, 2021

Why are there so many packages dealing with tables, and how to pick the right ones?

2  Asked on April 16, 2021 by rob-h

Pagebreak in an algorithm using algstore/algrestore

0  Asked on April 16, 2021

Enabling authoryear citation style with urlbst

1  Asked on April 16, 2021 by ea304gt

How to get tabulate to expand vertically to fit larger text in ConTeXt?

1  Asked on April 16, 2021

How to insert a block in a formula

1  Asked on April 16, 2021

Exsol package didn’t work with me

1  Asked on April 16, 2021

Unicode characters from Julia website

1  Asked on April 16, 2021

Why doesn’t a code from an answer compile?

0  Asked on April 15, 2021

pgfplots – beamer reveals not working with “set layers”

1  Asked on April 15, 2021

How to remove subsection extra spacing

0  Asked on April 15, 2021

Why mathbf cannot be redefined?

1  Asked on April 15, 2021 by lygamac

How to align the enumerate items using enumitem?

1  Asked on April 15, 2021 by tajiri_numero_1

Unable to Wrap Text inside Table in Beamer

2  Asked on April 15, 2021 by ravi-joshi

example from “novel” book class does not compile

0  Asked on April 15, 2021 by tfran

Custom fonts causing LaTeX (XeLaTeX compiler) to weird out

0  Asked on April 15, 2021

How to write without affecting the vertical positions of the next/previous elements?

3  Asked on April 15, 2021