I want that if a label intersects any of my edges then the label is above the edges. I am also using Overleaf. I tried to fill the label white but it does not remove all intersections.
\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx} % Required for inserting images
\usepackage{tikz}
\usepackage{amsthm}
\usetikzlibrary {calc,positioning,shapes.misc}
\usetikzlibrary{matrix}
\usepackage[a4paper, total={6in, 8in}]{geometry}
\usetikzlibrary{calc}
\usetikzlibrary {arrows.meta}
\usetikzlibrary {shapes.geometric}
\usepackage{algorithm}
\usepackage{mathrsfs}
\usepackage{algpseudocode}
\usepackage{stmaryrd}
\usetikzlibrary {automata,positioning}
\title{Angluin Description with Examples and Illustrations}
\author{Coping Forever}
\date{January 2024}
\begin{document}
\begin{tikzpicture}[
node distance=2cm,
every initial by arrow/.style={text=white,->},
line width=1pt,
mylabel/.style={font=\bfseries, inner sep=2pt, rectangle, draw=black,fill=white}
]
\node[state, initial, initial where=right, initial text={}] (s0) at (4.00, 0.00) {$s_0$};
\node[state,accepting] (s1) at (2.00, 3.46) {$s_1$};
\node[state] (s2) at (-2.00, 3.46) {$s_2$};
\node[state] (s3) at (-4.00, 0.00) {$s_3$};
\node[state] (s4) at (-2.00, -3.46) {$s_4$};
\node[state] (s5) at (2.00, -3.46) {$s_5$};
\path[arrows = {-Latex[line width=3pt, length=10pt]}] (s0) edge[bend right] node [mylabel] {0} (s1);
\path[->] (s0) edge[bend right] node [mylabel] {1} (s3);
\path[->] (s1) edge[loop above] node [mylabel] {0} ();
\path[->] (s1) edge[bend right] node [mylabel] {1} (s3);
\path[->] (s2) edge[bend right] node [mylabel] {0} (s5);
\path[->] (s2) edge[bend right] node [mylabel] {1} (s1);
\path[->] (s3) edge[bend right] node [mylabel] {0} (s2);
\path[->] (s3) edge[bend right] node [mylabel] {1} (s4);
\path[->] (s4) edge[bend right] node [mylabel] {0} (s3);
\path[->] (s4) edge[bend right] node [mylabel] {1} (s2);
\path[->] (s5) edge[bend right] node [mylabel] {0} (s4);
\path[->] (s5) edge[loop above] node [mylabel] {1} ();
\end{tikzpicture}
\end{document}
after fill=white I got this



edge[bend right]byto[in= ,out= ]AND enter suitable in/out angles. See e.g. here: https://tikz.dev/library-edges#sec-74.3 – MS-SPO Jan 19 '24 at 18:05\path[->] (s1) edge[bend right] node [mylabel] {1} (s3);to the last line. Thenfill=whitedoes what you want. – cfr Jan 19 '24 at 18:14