Can a node with a self-loop be a leaf node? Or maybe leaf is defined only for simple graphs (no self-loop, no multiple edges)? I can’t find the answer. I found various definitions, but nowhere an answer for this.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A graph with a loop isn’t a tree but a graph with a cycle. Leaves are defined for trees only.
Let’s take a more formal approach. A self-loop adds 2 to the degree of a vertex, or 1 to both indegree and outdegree in case of directed graphs. Assuming that a leaf is a vertex with outdegree 0 (and indegree 1, but that’s guaranteed by a definition of a tree), a vertex with a self-loop cannot be a leaf.