1 Introduction

The digraph polynomials and functions arising through the colorings are invariants that encode various statistics associated with the digraphs. One of the most sought-after problems with respect to these digraph invariants is the following: can the invariants uniquely determine the digraphs? If not, which classes of digraphs are distinguishable by these invariants? These questions have been investigated for various invariants [1,2,3,4,5], and are sort of digraph analogues of the Stanley’s Tree Isomorphism conjecture, which posits that the chromatic symmetric function of trees distinguishes them up to isomorphism.

Our digraph polynomials of interest in the above context are the B-polynomial and the quasisymmetric B-function introduced by Awan and Bernardi in [6]. These invariants respectively extend the Tutte polynomial [7] and Tutte symmetric function [8] to digraphs using the Potts model as an intermediary.

Definition 1

[6, Theorem 3.1]. For a digraph D(VA), the B-polynomial \( B_D(x,y,z) \) is the unique trivariate polynomial, such that for every positive integer k,

$$\begin{aligned} B_D(k,y,z) = \sum _{f: V \rightarrow [k]}y^{ asc (f)}z^{ dsc (f)}, \end{aligned}$$

where \([k] {:}{=}\{1,2,\dots ,k\}\) and \( asc (f)\) (resp. \( dsc (f)\)) denotes the number of arcs uv in A such that \(f(u) < f(v)\) (resp. \(f(u)> f(v)\)). Moreover, the expansion of the B-polynomial in the binomial basis is given by

$$\begin{aligned} B_D(x,y,z) = \sum _{p=1}^{|V|}\left( {\begin{array}{c}x\\ p\end{array}}\right) \left( \sum _{g \in {\text {{Surj}}}(V,p)} y^{ asc (g)} z^{ dsc (g)}\right) , \end{aligned}$$
(1.1)

where \({\text {{Surj}}}(V,p)\) is the collection of surjective colorings from V to [p].

The Tutte polynomial has been extensively studied in various fields and remains an active area of study, primarily due to its universal deletion-contraction property. A detailed survey of results pertaining to the Tutte polynomial can be found in [9, 10].

The B-polynomial is interesting to study in its own right as it simultaneously generalizes the chromatic polynomial, strict order polynomial, and weak order polynomial. It also provides various generating functions formulation of the above polynomials for digraphs. The B-polynomial extends the Tutte polynomial in the following way. The Tutte polynomial of a graph G is equivalent to the B-polynomial of the digraph obtained by replacing every edge in G with a pair of opposite arcs. The digraph is called as symmetrization of the graph G.

In the former part of this paper, we solve the following open question raised in [6] concerning the identification of digraphs obtained by symmetrization.

Question 2

[6, Question 10.3]. Is it true that \(B_D(x,y,z)\) is a function of x and yz if and only if D is a symmetrization of some graph G?

In Theorem 7, we prove that the answer to the above question is in the affirmative. In other words, we establish that the B-polynomial differentiates the classes of digraphs obtained through symmetrization from all other digraphs.

The next natural question would be to examine which classes of digraphs are distinguished by the B-polynomial, that is, to determine the class \(\mathcal {D}\) of digraphs such that every pair of non-isomorphic digraphs in it have distinct B-polynomial. Unfortunately, the B-polynomial is ineffective in distinguishing orientations of a fixed graph, as there are numerous pairs of non-isomorphic digraphs with the same B-polynomial (for example, see Fig. 1a). This is one of the motivations for introducing a quasisymmetric extension of the B-polynomial and investigating the classes of digraphs that can be distinguished by this extension. One may view this phenomenon as an analogy to the fact that all trees of a fixed order have the same chromatic polynomial, but the chromatic symmetric function holds the potential to distinguish all trees.

Definition 3

[6, Section 8]. Let \(\mathbb {P}\) be the set of positive integers and \(\mathrm {\textbf{x}}= (x_1,x_2,\dots )\) denote the list of commutative indeterminates. For a digraph D(VA), the quasisymmetric B-function is defined as

$$\begin{aligned} B_{D}(\mathrm {\textbf{x}};y,z) = \sum _{f:V \rightarrow \mathbb {P}} \left( x_1^{|f^{-1}(1)|}x_2^{|f^{-1}(2)|}x_3^{|f^{-1}(3)|}\cdots \right) y^{ asc (f)} z^{ dsc (f)}. \end{aligned}$$
(1.2)

The above digraph invariant is a quasisymmetric analog of the Tutte symmetric function, and determines other digraph and poset invariants like order quasisymmetric function, P-partition enumerator and chromatic quasisymmetric function [11, 12]. Note that by symmetrizing non-isomorphic graphs with equal Tutte Symmetric functions, one may obtain non-isomorphic digraphs with the same quasisymmetric B-functions. Therefore, we are interested in the investigation of the following general question.

Question 4

[6, Ques 10.7(i)]. Does quasisymmetric B-function distinguish acyclic digraphs?

A canonical way to obtain a poset from an acyclic digraph D is by defining a partial order \(u \preceq v\) iff there is a directed path from u to v in D. Under this correspondence, the study of distinguishing digraphs and posets by their quasisymmetric functions is closely related and actively investigated: In [2], it was proven that the order quasisymmetric function distinguishes naturally labeled posets that are \((\textsf{N},\bowtie )\)-free, a class that includes rooted trees. Furthermore, in [4], they demonstrated that all \(\textsf{N}\)-free naturally labeled posets can be distinguished by the P-partition enumerator. Additionally, in [5], labeled rooted trees, along with certain weak edges, are distinguished by their \((P,\omega )\)-partition enumerator.

A stronger and somewhat more challenging problem than distinguishing digraphs is their “reconstruction”. The previously mentioned results focus on distinguishing non-isomorphic orientations but do not provide a mechanism for their reconstruction. However, J. Zhou has addressed the reconstruction of rooted trees based on their order quasisymmetric function in [3].

Fig. 1
figure 1

The pair of digraphs in a and b have distinct quasisymmetric B-functions

In this paper, we primarily focus on the reconstruction of digraphs from their quasisymmetric B-functions. Certainly, the quasisymmetric B-function is a stronger invariant than the chromatic quasisymmetric function and P-partition enumerator (see Fig. 1). One of the main reasons for this is that the quasisymmetric B-function encodes the in-out degree sequence and the height-profile of digraphs [6, Pg 230]. However, these quantities are not sufficient to distinguish the orientations of even simple graphs such as paths. For example, Fig. 2 depicts non-isomorphic orientations of paths with the same in-out degree sequence and height-profile.

Therefore, the problem of distinguishing orientations of paths by quasisymmetric functions is still open.

Fig. 2
figure 2

Two non-isomorphic oriented paths containing ‘\(\textsf{N}\)’, and having the same in-out degree sequence and height-profile (3, 3, 2)

In the latter part of this paper, we show that partially symmetric orientations (see Definition 15) of certain caterpillars can be reconstructed from their quasisymmetric B-functions.

A tree is said to be a caterpillar if all the vertices of degree at least two induce a (unique) path, which we call as the spine of the caterpillar. We now define the following subclasses of caterpillars.

Definition 5

  1. (a)

    A proper caterpillar is a caterpillar that has every vertex of the spine adjacent to at least one pendant vertex.

  2. (b)

    A proper caterpillar is said to be an asymmetric proper caterpillar if the number of pendant vertices adjacent to each spine vertex is distinct.

The class of caterpillars has been shown to be reconstructible from chromatic symmetric functions [13,14,15]. Since the chromatic symmetric function of the underlying digraph is determined by the quasisymmetric B-function, it is sufficient to focus on the reconstruction problem of the orientations while fixing the underlying caterpillar. For proper caterpillars, we establish in Theorem 16 that their partially symmetric orientations are reconstructible. Implementing the methods involved in reconstruction of the spine, we are able to reconstruct all the orientations of paths up to isomorphism. Using this and the fact that in-out degree sequence is extractible from the quasisymmetric B-functions, we prove the reconstruction of all orientations of asymmetric proper caterpillars in Theorem 17.

To the best of our knowledge, Corollary 14 along with Theorems 16 and 17 mark the first instance of reconstructing digraphs containing ‘\(\textsf{N}\)’ using a quasisymmetric function. Furthermore, these results offer a partial solution to the problem presented in [6, Question 10.7(ii)] and also encourage further exploration of [5, Conjectures 1.2 and 1.3].

The paper is structured as follows: we begin by introducing graph notations and preliminary concepts. Next, we present the proof of Theorem 7. In Sect. 4, we focus on proving Theorems 16 and 17. We conclude with a discussion on further questions and future prospects related to the study of B-polynomial and the quasisymmetric B-function.

2 Notations and Preliminaries

A graph G is an ordered pair (V(G), E(G)) , alternatively written as G(VE) , where V(G) is a finite set of vertices, and E(G) is a multiset of edges. An edge \(\{u,v\}\) is incident to vertices u and v. Similarly, a digraph D is an ordered pair (V(D), A(D)) , where V(D) represents the finite set of vertices and A(D) represents the multiset of arcs in D. An arc \( uv \in A(D) \) is said to be outgoing from u and incoming to v. It is important to note that adjacency in a graph is a symmetric relation, but this symmetry need not hold in a digraph. The cardinality of the multiset of arcs incoming to v and outgoing from v is referred to as the in-degree and out-degree of vertex v, respectively. The underlying graph of D, denoted as \( \underline{D} \), is the graph obtained by replacing every arc uv in D with the edge \( \{u,v\} \). Henceforth, whenever we refer to an edge in a digraph, we mean the corresponding edge in the underlying graph.

The set of integers, positive integers, and the set of rationals are denoted by \(\mathbb {Z}\), \(\mathbb {P}\), and \(\mathbb {Q}\), respectively. For a positive integer p and a graph G(VE) (or D(VA)), a p-coloring of G is a mapping that assigns a color from the set [p] to each vertex in V. An edge (or arc) is said to be non-monochromatic under a coloring if its endpoints are assigned distinct colors.

For a commutative ring R with unity, we denote the ring of polynomials over indeterminates \( x_1,x_2,\dots ,x_n \) by \( R[x_1,x_2,\dots ,x_n] \). The notation \( [x_1^{\delta _1}x_2^{\delta _2}\cdots x_n^{\delta _n}]f(x_1, x_2, \ldots , x_n) \) denotes the coefficient of the monomial \( x_1^{\delta _1}x_2^{\delta _2}\cdots x_n^{\delta _n} \) in the polynomial \( f(x_1, x_2, \ldots , x_n)\). Let \( \textrm{QSym}_R(\mathrm {\textbf{x}}) \) denote the collection of formal power series in commutative indeterminates \( \mathrm {\textbf{x}}= (x_1,x_2,\dots )\) with coefficients in ring R such that for \((\delta _1,\delta _2,\dots ,\delta _k) \in \mathbb {P}^k\), every function \( f \in \textrm{QSym}_R(\mathrm {\textbf{x}}) \) satisfies

$$\begin{aligned}{}[x_{i_1}^{\delta _1}x_{i_2}^{\delta _2}\dots x_{i_k}^{\delta _k}]f = [x_{j_1}^{\delta _1}x_{j_2}^{\delta _2}\dots x_{j_k}^{\delta _k}]f, \end{aligned}$$

for all increasing k-tuples \(i_1< i_2<\cdots <i_k \) and \( j_1<j_2<\cdots <j_k \). The ring \( \textrm{QSym}_R(\mathrm {\textbf{x}}) \) is called the ring of quasisymmetric functions over R, and \( \textrm{QSym}_R^n(\mathrm {\textbf{x}}) \) denotes the collection of quasisymmetric functions of degree n.

For an integer composition \( \delta = (\delta _1,\dots ,\delta _k) \vDash n\), the quasisymmetric monomial function \( M_\delta \) is defined as

$$\begin{aligned} M_\delta := \sum _{i_1<i_2<\dots <i_k} x_{i_1}^{\delta _1}x_{i_2}^{\delta _2}\cdots x_{i_k}^{\delta _k}, \end{aligned}$$

where the sum is over all increasing k-tuples of positive integers. The collection \( \{M_\delta \}_{\delta \vDash n} \) forms an R-basis of \( \textrm{QSym}_R^n(\mathrm {\textbf{x}}) \)(see [16]). For a quasisymmetric function f, let \( [M_\delta ]f \) denote the coefficient of \(M_\delta \) obtained by expressing f in the monomial quasisymmetric basis over R.

It is evident that \( B_D(\mathrm {\textbf{x}};y,z) \) lies in \( \textrm{QSym}_{\mathbb {Z}[y,z]}^{|V|}(\mathrm {\textbf{x}}) \)(since any two colorings of D differing by an order-preserving bijection, have the same set of ascents and descents). The following proposition expresses the quasisymmetric B-function in the above monomial basis.

Proposition 6

[6]. For any digraph D(VA) , we have

$$\begin{aligned} B_D(\mathrm {\textbf{x}};y,z) = \sum _{p=1}^{|V|} \sum _{f \in {\text {{Surj}}}(V,p)} M_{{\textit{type}}(f)}y^{ asc (f)}z^{ dsc (f)}, \end{aligned}$$

where \({\textit{type}}(f)\) is the tuple \((|f^{-1}(1)|,|f^{-1}(2)|,\dots ,|f^{-1}(p)|)\) called the type of f.

We briefly recall that the in-out degree sequence of a digraph can be recovered from its quasisymmetric B-function. Given a digraph D(VA) and \(v\in V\), consider the coloring \(f_v\) that assigns color 1 to the vertex v and color 2 to the remaining vertices. Observe that every surjective coloring of type \((1,|V|-1)\) uniquely corresponds to a coloring \(f_v\) for some \(v\in V\), and satisfies \( y^{ asc (f_v)}z^{ dsc (f_v)} = y^{ \textrm{outdegree} \, \textrm{of} \, v }z^{ \textrm{indegree} \, \textrm{of} \, v } \). Therefore, we have

$$\begin{aligned}{}[M_{(1,|V|-1)}]B_{D}(\mathrm {\textbf{x}};y,z) = \sum _{v\in V}y^{ asc (f_v)}z^{ dsc (f_v)} = \sum _{v\in V}y^{{\textrm{outdegree} \, \textrm{of} \, v}}z^{{\textrm{indegree} \, \textrm{of} \, v}}. \end{aligned}$$
(2.3)

For an integer composition \(\beta \) of n, we define the following multisets containing the monomials of fixed degree corresponding to the surjective colorings.

$$\begin{aligned} {\text {Mon}}_{d}(\beta )&{:}{=}\{y^{ asc (f)}z^{ dsc (f)} \,\mid \, \textrm{type}(f) = \beta {\text { and }} asc (f)+ dsc (f) = d \}\\ {\text {Mon}}_{}(\beta )&{:}{=}\bigcup _{d\ge 0} {\text {Mon}}_{d}(\beta ) \end{aligned}$$

3 B-polynomial of Symmetric Digraphs

For the digraph obtained by symmetrizing an undirected graph G, its B-polynomial is contained in \(\mathbb {Q}[x, yz]\). This follows from the observation that, for any coloring of , the count of ascents and descents is the same. We establish that its converse is true as well.

Theorem 7

A digraph D is a symmetrization of some undirected graph G if and only if its B-polynomial is a function of x and yz.

Prior to the proof of the aforementioned theorem, we present a subset-sum expansion for \( B_D(x, y, z) \). This expansion is derived through the repetitive application of the following recurrence relation concerning opposite arcs proved in [6, Lemma 4.1]. For a digraph D(VA), and pair of opposite arcs \(e = \{uv,vu\}\) in A,

$$\begin{aligned} B_D(x,y,z) = (yz)B_{D\setminus e}(x,y,z) + (1-yz)B_{D/e}(x,y,z). \end{aligned}$$
(3.4)

Let \(A = A'\sqcup A''\) be a partition of the arc set A such that \(A'' \) is expressible as a disjoint union of opposite arc pairs \( \{uv,vu\} \), and \( A' \) consists of arcs uv such that the opposite arc vu does not belong to \(A'\) (see Fig. 3). The following proposition presents a subset-sum expansion of B-polynomial with respect to the set \( A'' \).

Fig. 3
figure 3

Partition of the arc set A into arc sets \(A' = \{v_1v_4,v_3v_2,2\cdot v_4v_5, v_5v_2, v_6v_2\}\) and \(A'' = \big \{ \{v_1v_2,v_2v_1\},\{v_1v_4,v_4v_1\}, 2\cdot \{v_5v_6,v_6v_5\} \big \}\)

Proposition 8

For digraph D(VA) , we have

$$\begin{aligned} {} B_D(x,y,z) = \sum _{R \sqcup S = A''} (yz)^{|R|}(1-yz)^{|S|}B_{D\setminus R/S}(x,y,z), \end{aligned}$$
(3.5)

where \( A'' \) is the set of doubletons containing pair of opposite arcs, and \(D{\setminus }R/S \) is the digraph obtained by deleting and contracting the pair of opposite arcs in R and S, respectively.

Proof

The proof is straightforward using (3.4) and induction on \(|A''|\). \(\square \)

We now proceed to the proof of Theorem 7. The main idea of the proof involves eliminating pair of opposite arcs using the proposition mentioned above and extract the highest degree term of the B-polynomial.

Proof

(Proof of Theorem 7) (\(\Leftarrow \)) We prove that if a digraph D(VA) is not a symmetrization of any undirected graph G, then its B-polynomial does not lie in \(\mathbb {Q}[x,yz] \). We treat \( B_D(x,y,z) \) as a polynomial over x with coefficients in ring \( \mathbb {Q}[y,z]\). From (1.1), it follows that the largest exponent of x in \(B_D(x,y,z)\) is equal to the number of vertices of D. Since contraction of arcs reduces the number of vertices, the largest exponent \(x^{|V|}\) appears only in the summand where no pair of opposite arcs is contracted, that is, when \(R = A''\) in (3.5). This leads to the following equality.

$$\begin{aligned} \left[ \left( {\begin{array}{c}x\\ |V|\end{array}}\right) \right] B_D(x,y,z)= & {} \left[ \left( {\begin{array}{c}x\\ |V|\end{array}}\right) \right] (yz)^{|A''|}B_{D\setminus A''}(x,y,z)\\ {}= & {} (yz)^{|A''|} \sum _{g \in {\text {{Surj}}}(V,|V|)} y^{ asc _{A'}(g)} z^{ dsc _{A'}(g)}. \end{aligned}$$

This implies that the leading coefficient of the B-polynomial of D is precisely \( (yz)^{|A''|} \) times the leading coefficient of \( D(V,A') \). Hence it suffices to prove the existence of a |V|-coloring of \(D(V,A')\) with distinct number of ascents and descents. Since \( D \ne \overset{\leftrightarrow }{G}\ \), the set of arcs \(A'\) is non-empty. Let \( uv \in A'\) and f be any surjective |V|-coloring such that \( f(u)=|V|-1 \) and \( f(v)=|V| \). If the number of ascents and descents of f are distinct, we are done. Suppose to the contrary that \( asc (f) = dsc (f) \). We define the coloring g obtained by interchanging the colors of u and v under f as follows:

$$\begin{aligned} g(w) = {\left\{ \begin{array}{ll} |V| &{} w =u, \\ |V|-1 &{} w = v, \\ f(w)&{} {\text {otherwise.}} \end{array}\right. } \end{aligned}$$

Let \(f^a\) (or \(f^d\)) and \(g^a\) (or \(g^d)\) denote the multiset of arcs occurring as ascents (or descents) under f and g, respectively. Note that the set of ascents and descents of f and g restricted to \(A'\setminus \{uv\} \) are the same, whereas \(\{uv\} = f^a \setminus g^a = g^d \setminus f^d\). This implies that \( asc (g) = asc (f) - 1\) and \( dsc (g) = dsc (f) + 1\), and consequently \( asc (g) \ne dsc (g)\). Thus \(B_D(x,y,z) \notin \mathbb {Q}[x,yz]\). \(\square \)

4 Distinguishing Orientations of Caterpillars

In this section, we show that the quasisymmetric B-function (henceforth abbreviated as \({\text {QBF}}\)) distinguishes certain orientations of proper caterpillars up to isomorphism. Moreover, we prove that all orientations of the paths and asymmetric proper caterpillars are reconstructible up to isomorphism from their \({\text {QBF}}\)s.

An equivalent characterization of a caterpillar is that it is a tree where deletion of all its pendant vertices results in a path. This resultant path is in fact the spine of the caterpillar. For a caterpillar C, we denote its spine by \(\langle v_1,v_2,\dots ,v_{\ell } \rangle \) that starts at \(v_1\) and ends at \(v_{\ell }\). Let \(u_{k1},u_{k2},\dots \) denote the pendant vertices adjacent to \(v_k\). Let \({\text {Comp}}(C)\) be the unique integer composition \((\alpha _1,\alpha _2,\dots ,\alpha _{\ell })\) associated to C such that for \(i = 1,2,\dots ,\ell \), the spine vertex \(v_i\) has exactly \(\alpha _i-1\) many neighbors with degree 1. Note that the integer compositions associated with isomorphic caterpillars are either the same or reverses of each other.

Fig. 4
figure 4

An oriented proper caterpillar with associated composition (2, 2, 3, 4, 2, 3, 2)

For an oriented caterpillar and its spine vertex \(v_k\), let \(O_k\) and \(I_k\) denote the number of outgoing and incoming pendant arcs of \(v_k\). The tuple \(P(v_k){:}{=}(O_k,I_k)\) is called as the pendant vector of the spine vertex \(v_k\). For instance, the pendant vector of the spine vertex \(v_4\) in Fig. 4 is (2, 1). Note that any orientation of a fixed caterpillar C is uniquely determined by (a) the orientation of the spine \(\langle v_1,v_2,\dots ,v_{\ell } \rangle \), and (b) the pendant vector \(P(v_k)\) of each spine vertex \(v_k\).

For an integer composition \(\delta \vDash |V(T)|\), let \(F_T(\delta )\) denote the set of surjective colorings of T having type \(\delta \) with exactly \(\ell (\delta )-1\) many non-monochromatic edges. The following observations enable us to characterize the colorings of trees, their non-monochromatic arcs and the corresponding monomials.

Observation 9

Let T(VE) be a tree and \(\beta = (\beta _1,\beta _2,\dots ,\beta _k)\) be an integer composition of |V|. Then

  1. (a)

    A coloring f is in \(F_T(\beta )\) if and only if the deletion of its non-monochromatic edges results in k many connected components of orders \(\beta _1,\beta _2,\dots ,\beta _k\).

  2. (b)

    If each component of \(\beta \) is greater than 1, then the endpoints of the non-monochromatic edges of colorings in \(F_T(\beta )\) must have degree greater than 1 in T. Particularly for caterpillars, the non-monochromatic edges of such colorings must lie on the spine.

The above observations follow from the fact that every edge of a tree is a cut-edge. We begin with the classification of the spine edges of all caterpillars according to the partial sums of the corresponding integer compositions. Let C(VE) be a caterpillar with associated composition \({\text {Comp}}(C) = (\alpha _1,\alpha _2,\dots ,\alpha _{\ell })\). For \(p = 1,2,\dots ,\ell \), let \(L_p {:}{=}\sum _{i=1}^{p} \alpha _i\) and \(R_p {:}{=}\sum _{i=1}^p \alpha _{\ell -i+1}\) be the left and right justified partial sums of \({\text {Comp}}(C)\), respectively. We now define the bilateral edges based on the equality of these partial sums. Let

$$B = \left\{ (p,p') \in [\ell ]\times [\ell ] \;\big |\; L_p = R_{p'} {\text { and }} L_p,R_{p'} \le \lfloor |V|/2\rfloor \right\} .$$

For \((p,p') \in B\), let \(B_{p,p'}\) denote the set of edges \(\big \{ \{v_{p},v_{p+1}\},\{v_{\ell -p'},v_{\ell -p'+1} \} \big \}\). We call \(B_{p,p'}\) as a bilateral set, and a spine edge is said to be bilateral if it belongs to \(B_{p,p'}\) for some \(1 \le p,p'\le \ell \). Note that \(|B_{p,p'}|\) is either one or two, and the former scenario occurs if and only if |V| is even and \(L_p = R_{p'} = |V|/2\). For an oriented caterpillar, we denominate the orientation of the bilateral set \(B_{p,p'}\) according to its bilateral edges as follows:

Definition 10

Let \(\overset{\rightarrow }{C}(V,E)\) be an oriented caterpillar. For \(2 \le L_p = R_{p'} \le \lfloor |V|/2\rfloor \), the bilateral set \(B_{p,p'}\) admitting the orientation

  • \(\left\{ v_pv_{p+1},v_{\ell -p'}v_{\ell -p'+1} \right\} \) are called right directed (Fig. 5:(i)),

  • \(\left\{ v_{p+1}v_{p},v_{\ell -p'+1}v_{\ell -p'} \right\} \) are called left directed (Fig. 5:(ii)),

  • \(\left\{ v_{p}v_{p+1},v_{\ell -p'+1}v_{\ell -p'} \right\} \) is called inward directed (Fig. 5:(iii)),

  • \(\left\{ v_{p+1}v_{p},v_{\ell -p'}v_{\ell -p'+1} \right\} \) is called outward directed (Fig. 5:(iv)).

A bilateral set is called uni-directed if it is either left directed or right directed. For example, the bilateral sets \(B_{1,1}\) and \(B_{3,3}\) in Fig. 4 are inward and right directed, respectively.

Fig. 5
figure 5

Orientations of the bilateral set \(B_{p,p'}\)

The following proposition asserts that the orientation of the spine arcs can be read from the multiset \({\text {Mon}}_{1}(s,|V|-s)\) up to uni-direction of bilateral sets.

Proposition 11

Let \(\overset{\rightarrow }{C}(V,E)\) be an oriented caterpillar with \({\text {Comp}}(C) = (\alpha _1,\alpha _2,\dots ,\alpha _{\ell })\). For \(L_p,R_{p'} \le \lfloor |V|/2\rfloor \) such that the arcs with endpoints \(\{v_{p},v_{p+1}\}\) and \(\{v_{\ell -p'},v_{\ell -p'+1}\}\) are not bilateral, the multiset

$$\begin{aligned} {\text {Mon}}_{1}(L_p,|V|-L_p) = {\left\{ \begin{array}{ll} \{y\} &{} \text {iff } v_pv_{p+1} \in A, \\ \{z\} &{} \text {iff } v_{p+1}v_p \in A. \\ \end{array}\right. } \end{aligned}$$
(4.6)

and

$$\begin{aligned} {\text {Mon}}_{1}(R_{p'},|V|-R_{p'}) = {\left\{ \begin{array}{ll} \{y\} &{} \text {iff } v_{\ell -p'+1}v_{\ell -p'} \in A, \\ \{z\} &{} \text {iff } v_{\ell -p'}v_{\ell -p'+1} \in A. \\ \end{array}\right. } \end{aligned}$$
(4.7)

For the bilateral set \(B_{p,p'}\) with \(s = L_p = R_{p'}\), we have

$$\begin{aligned} {\text {Mon}}_{1}(s,|V|-s) = {\left\{ \begin{array}{ll} \{y,z\} &{} \text {iff } B_{p,p'} \text { is uni-directed}, \\ \{2y\} &{} \text {iff } B_{p,p'} \text { is inward directed}, \\ \{2z\} &{} \text {iff } B_{p,p'} \text { is outward directed}. \\ \end{array}\right. } \end{aligned}$$
(4.8)

Proof

According to Observation 9(b), the non-monochromatic edges of the colorings from \(F_C(L_p,|V|-L_p)\) and \(F_C(R_{p'},|V|-R_{p'})\) are \(\{v_{p},v_{p+1}\}\) and \(\{v_{\ell -p'},v_{\ell -p'+1}\}\), respectively. The coloring(s) in \(F_C(L_p,|V|-L_{p})\) (resp. \(F_C(R_{p'},|V|- R_{p'})\)) assigns color 1 to the vertex \(v_p\) (resp. \(v_{\ell -p'+1}\)). Therefore, the orientations of the non-monochromatic edges correspond to the asserted multisets in (4.6), (4.7) and (4.8). \(\square \)

This leads us to the following corollary.

Corollary 12

Let be an oriented caterpillar. If none of the bilateral set \(B_{p,p'}\) of is uni-directed, then the orientation of the spine can be determined by the \({\text {QBF}}\).

It is worth noting that the information of the non-uni-directed bilateral sets, along with the already known digraph-statistics from the \({\text {QBF}}\) like in-out degree sequence and height-profile are insufficient to distinguish the orientation of the spine. In fact, there exist non-isomorphic orientations of paths that agree on the above quantities (see Fig. 2). Therefore the determination of uni-directed bilateral sets is crucial and non-trivial. By imposing certain conditions on the underlying caterpillars, we show that the orientations of the spine including the uni-directed bilateral sets can be reconstructed from the \({\text {QBF}}\).

4.1 Proper Caterpillars

Recall that a caterpillar is said to be proper if every vertex of the spine is adjacent to at least one pendant vertex. Equivalently, they are the caterpillars whose associated compositions have each component of size at least two. The advantage of studying the proper caterpillars over non-proper caterpillars is that the composition corresponding to proper caterpillars have all parts greater than 1. Therefore the compositions obtained by adding some consecutive components must also have all parts greater than 1. From Observation 9(b), it follows that the non-monochromatic edges of the colorings of these type always lie on the spine. This avoids the conflict arising due to the involvement of the pendant vector while retrieving the spine. With this, we begin with reconstructing the spine of the proper caterpillars.

Proposition 13

The orientation of the spine of oriented proper caterpillars can be reconstructed from their quasisymmetric B-functions.

Proof

Let be an orientation of a proper caterpillar C such that \({\text {Comp}}(C) = (\alpha _1,\alpha _2,\dots ,\alpha _{\ell })\) is lexicographically smaller than its reverse. Let \(\theta \) be the least positive integer (if exists) such that \(B_{\theta ,\theta '}\) is uni-directed. In the first step of the proof, we use \(B_{\theta ,\theta '}\) as our pivot to determine whether the other bilateral sets are oriented in the same direction as \(B_{\theta ,\theta '}\) or not. In the second step, we aim to determine the direction of this \(B_{\theta ,\theta }\), which will in turn discern the orientation of every other uni-directional bilateral set. Let \(\pi \) be the least positive integer (if exists) such that the edge \(\{v_{\pi },v_{\pi +1}\}\) is not a bilateral edge. The choice of \({\text {Comp}}(C)\) being lexicographically smaller than its reverse implies \(L_\pi \le \lfloor |V/2|\rfloor \). Since the orientation of the non-uni-directed bilateral sets is determined by \({\text {QBF}}\) (from Proposition 11), the orientation of edge \(\{v_{\pi },v_{\pi +1}\}\) in is known. This arc acts as our pivot in the second step to determine the orientation of the uni-directed bilateral set \(B_{\theta ,\theta '}\).

Any two uni-directed bilateral sets of are said to be in unison if either both are left directed or both are right directed.

(Step I): We proceed by induction on \(s \in \{L_{p} \;|\; B_{p,p'} \text { is uni-directed}, p\ge \theta , p' \ge \theta ' \}\). Suppose that for all \(q<p\) and \(q'<p'\), we know whether \(B_{q,q'}\) is in unison with \(B_{\theta ,\theta '}\) or not. To determine the direction of \(B_{p,p'}\), we consider the surjective 3-colorings whose non-monochromatic arcs belong to \(B_{p,p'}\) or \(B_{\theta ,\theta '}\). In particular, to have

$$\begin{aligned} {} \big \{ \{ v_{\theta },v_{\theta +1} \}, \{v_{p},v_{p+1} \} \big \} \text { or } \big \{ \{ v_{\ell -\theta '},v_{\ell -\theta '+1} \}, \{v_{\ell -p'},v_{\ell -p'+1} \} \big \} \end{aligned}$$
(4.9)

as non-monochromatic edges, the natural choice would be to consider the colorings such that removal of their non-monochromatic edges results in connected components of order \(L_{\theta },L_p-L_{\theta }\) and \(|V|-L_p\). While doing so, we may encounter some other colorings in this set. However by induction hypothesis, the orientations of the non-monochromatic edges of these intermediary colorings are already known. The occurrence of the intermediary arcs is based on whether \(L_p - L_{\theta }\) occurs as a partial sum of parts of \({\text {Comp}}(C)\). The proof follows from the case-by-case analysis of the non-monochromatic arcs of these intermediary colorings. We accomplish this by considering set of colorings \(F_C(L_{\theta },L_p-L_{\theta },|V|-L_p)\) or \(F_C(L_{\theta },|V|-L_p,L_p-L_{\theta })\). We show that for each possible orientation of intermediary arcs, the multisets associated with the unison of \(B_{p,p'}\) and \(B_{\theta ,\theta '}\) differs from the case when they are not in unison. If none of the partial sum of the parts equal \(L_p-L_{\theta }\), then

$$\begin{aligned} {\text {Mon}}_{2}(L_{\theta },|V|-L_p,L_p-L_{\theta }) = {\left\{ \begin{array}{ll} \{2yz\} &{} \text {if } B_{p,p'} \text { and } B_{\theta ,\theta '} \text { are in unison,}\\ \{y^2,z^2\} &{} \text {otherwise}. \end{array}\right. } \end{aligned}$$
Table 1 Set of colorings \(F_C({\textit{L}}_i,{\textit{L}}_j-{\textit{L}}_i,|V|-{\textit{L}}_j) = \{g_1,g_2,\dots ,g_6\}\) and \(F_C(L_i,|V|-L_i,L_j-L_i) = \{f_1,f_2,\dots ,f_6\}\) where \({\textit{L}}_i={\textit{R}}_{i'},\,{\textit{L}}_j={\textit{R}}_{j'}\) and \({\textit{L}}_{j}-{\textit{L}}_i = {\textit{L}}_k={\textit{R}}_{k'}\)

(Case 1): \(L_p-L_{\theta } = L_q = R_{q'}\) for some \(q \le p\) and \(q'\le p'\).

The computation of monomials in \({\text {Mon}}_{2}(L_{\theta },L_p-L_{\theta },|V|-L_{p})\) and \({\text {Mon}}_{2}(L_{\theta },|V|-L_{p},L_p-L_{\theta })\) in accordance with Table 1 (where \(i = \theta , j = p\) and \( k = q\)) lead to the following. In the first three rows of the following computation table, we calculate the multiset \( {\text {Mon}}_{2}(L_{\theta },L_{p}-L_{\theta },|V|-L_{p})\), while the last row represents the multiset \({\text {Mon}}_{2}(L_{\theta },|V|-L_{p},L_{p}-L_{\theta })\).

Orientation of \(B_{q,q'}\)

\(B_{p,p'} \) is in unison with \(B_{\theta ,\theta '}\)

\(B_{p,p'} \) is not in unison with \(B_{\theta ,\theta '}\)

inward directed

\(\{2y^2,2yz,2z^2\}\)

\(\{y^2,4yz,z^2\}\)

outward directed

\(\{2y^2,2yz,2z^2\}\)

\(\{y^2,4yz,z^2\}\)

not in unison with \(B_{\theta ,\theta '}\)

\(\{3y^2,3z^2\}\)

\(\{y^2,4yz,z^2\}\)

unison with \(B_{\theta ,\theta '}\)

\(\{y^2,4yz,z^2\}\)

\(\{3y^2,3z^2\}\)

(Case 2): Either \(L_p-L_{\theta }\) is equal to \( L_{p}\) for some \(q \le p\), or \(R_{q'}\) for some \(q'\le p'\) (but not both).

Apart from (4.9), the other non-monochromatic edges of the colorings in \(F_C(L_{\theta },|V|-L_{p},L_p-L_{\theta })\) are

$$\begin{aligned} \begin{array}{ll} \big \{ \{v_{q},v_{q+1}\},\{v_{p},v_{p+1} \} \big \}, \big \{ \{v_{q},v_{q+1}\},\{v_{\ell -\theta '},v_{\ell -\theta '+1}\} \big \} &{}\text { if }L_p-L_{\theta } = L_{q}, \\ \big \{ \{v_{\ell -q'},v_{\ell -q'+1}\},\{v_{p},v_{p+1} \} \big \}, \big \{ \{v_{\ell -q'},v_{\ell -q'+1}\},\{v_{\ell -\theta '},v_{\ell -\theta '+1}\} \big \} &{}\text { if }L_p-L_{\theta } = R_{q'}. \\ \end{array} \end{aligned}$$

Therefore, when \(v_{q}v_{q+1}\) or \(v_{\ell -q'+1}v_{\ell -q'}\) occur in , we have

$$\begin{aligned} {\text {Mon}}_{2}(L_{\theta },|V|-L_{p},L_p-L_{\theta }) = {\left\{ \begin{array}{ll} \{3yz,z^2\} &{} \text { if }B_{p,p'} \text { and }B_{\theta ,\theta '} \text { are in unison, }\\ \{y^2,yz,2z^2\} &{} \text { if }B_{p,p'} \text { and }B_{\theta ,\theta '} \text { are not in unison. } \end{array}\right. } \end{aligned}$$

Otherwise if \(v_{q+1}v_{q}\) or \(v_{\ell -q'}v_{\ell -q'+1}\) occur in , we get

$$\begin{aligned} {\text {Mon}}_{2}(L_{\theta },|V|-L_{p},L_p-L_{\theta }) = {\left\{ \begin{array}{ll} \{y^2,3yz\} &{} \text {if } B_{p,p'} \text { and } B_{\theta ,\theta '} \text { are in unison,}\\ \{2y^2,yz,z^2\} &{} \text {if } B_{p,p'} \text { and } B_{\theta ,\theta '} \text { are not in unison.} \end{array}\right. } \end{aligned}$$

Since the multisets associated with the unison of \(B_{p,p'}\) and \(B_{\theta ,\theta '}\) are distinct from the case when they are not in unison, we conclude that the uni-directed bilateral arcs that are in unison with \(B_{\theta ,\theta '}\) can be determined from the \({\text {QBF}}\).

Note that if the underlying proper caterpillar C is a palindrome, then every edge is a bilateral edge. Therefore, by assuming \(B_{\theta ,\theta '}\) being right directed, we are fixing an orientation from the isomorphism class of , and the direction of every other bilateral set in this orientation can be determined. Thus, if \({\text {Comp}}(C)\) is a palindrome, then orientation of spine can be reconstructed from (Step I). We now proceed to determine the direction of \(B_{\theta ,\theta '}\) when the underlying composition is not a palindrome.

(Step II): The direction of \(B_{\theta ,\theta '}\) is discerned by comparing it with the orientation of the pivot non-bilateral edge \(\{v_{\pi },v_{\pi +1}\}\). Note that the edge \(\{v_{\pi },v_{\pi +1}\}\) may occur either before or after the bilateral edge \(\{v_{\theta },v_{\theta +1}\}\) on the spine (see Fig. 6), that is, either \(\pi < \theta \) (in the former scenario) or \(\pi > \theta \) (in the latter scenario).

Fig. 6
figure 6

Proper caterpillars with associated compositions a (2,2,2,2,2,4) and b (2,2,2,2,4,2)

For \(\pi < \theta \), the computations are based on the Table 1 with \(i = \pi , j = \theta \) and \(k = q\).

(Case 1.a): Suppose \(\pi < \theta \), and \(L_{\theta }-L_{\pi }\) is not a partial sum of components of \({\text {Comp}}(C)\).

The multiset \({\text {Mon}}_{2}(L_{\pi },|V|-L_{\theta },L_{\theta }-L_{\pi })\) contains a unique monomial contributed by the coloring with non-monochromatic edge set \(\big \{\{v_{\pi },v_{\pi +1}\},\{ v_{\theta },v_{\theta +1} \} \big \}\). From Table 1, we conclude that

$$\begin{aligned} {\text {Mon}}_{2}(L_{\pi },|V|-L_{\theta },L_{\theta }-L_{\pi }) = {\left\{ \begin{array}{ll} \{y^2\} &{} \text {if } v_{\pi }v_{\pi +1} \in A \text { and } B_{\theta ,\theta '} \text { is right directed,}\\ \{z^2\} &{} \text {if }v_{\pi +1}v_{\pi } \in A \text { and } B_{\theta ,\theta '} \text { is left directed,}\\ \{yz\} &{} \text {otherwise}. \end{array}\right. } \end{aligned}$$

(Case 1.b): Let \(L_{\theta }-L_{\pi }\) be either \( L_{q} \) or \(R_{q'}\) (but not both) for some \(1 \le q \le \theta \) and \(1 \le q' \le \theta '\).

The distinctness of the multiset \({\text {Mon}}_{2}(L_{\pi },|V|-L_{\theta },L_{\theta }-L_{\pi })\) is exhibited in the respective scenarios by the following:

\(B_{\theta ,\theta '}\)

\(v_{\pi }v_{\pi +1}\)

\(v_{\pi +1}v_{\pi }\)

 

Right directed

Left directed

Right directed

Left directed

\(v_{q}v_{q+1}\)

\(\{2yz\}\)

\(\{2y^2\}\)

\(\{yz,z^2\} \)

\(\{y^2,yz\}\)

\(v_{q+1}v_{q}\)

\(\{yz,z^2\}\)

\(\{y^2,yz\}\)

\(\{2z^2\}\)

\( \{2yz\}\)

\(v_{\ell -q'}v_{\ell -q'+1} \)

\(\{y^2,2yz\}\)

\(\{3y^2\}\)

\(\{2yz,z^2\}\)

\( \{y^2,2yz\}\)

\(v_{\ell -q'+1}v_{\ell -q'}\)

\(\{2yz,z^2\}\)

\( \{y^2,2yz\}\)

\(\{3z^2\}\)

\(\{2yz,z^2\}\)

where the first two rows and the last two rows corresponds to \(L_{\theta }-L_{\pi }\) being \(L_{q} \) or \(R_{q'}\), respectively.

(Case 1.c): Let \(L_{\theta }-L_{\pi } = L_{q} = R_{q'}\) for some \(1 \le q \le \theta \) and \(1 \le q' \le \theta '\).

By the choice of \(B_{\theta ,\theta '}\) (least uni-directed bilateral set), the bilateral sets \(B_{q,q'}\) must be either inward directed or outward directed. The monomials computed using Table 1 gives the following:

\(B_{q,q'}\) and \(B_{\theta ,\theta '}\)

\(v_{\pi }v_{\pi +1}\)

\(v_{\pi +1}v_{\pi }\)

 

Right directed

Left directed

Right directed

Left directed

Inward directed

\(\{3yz,z^2\}\)

\(\{ y^2,2yz,z^2\}\)

\(\{yz,3z^2 \} \)

\(\{ 2yz,2z^2\}\)

Outward directed

\(\{2y^2,2yz\}\)

\(\{ 3y^2,yz\}\)

\(\{2yz,2z^2\}\)

\( \{ y^2,3yz\} \)

where the the multiset \({\text {Mon}}_{2}(L_{\theta },|V|-L_{\pi },L_{\pi }-L_{\theta })\) is computed corresponding to the orientation of \(B_{q,q'}, B_{\theta ,\theta '}\) and \(\{v_{\pi },v_{\pi +1} \}\).

This concludes that the direction of \(B_{\theta ,\theta '}\) can be reconstructed when the pivot arc \(\{v_{\pi },v_{\pi +1}\}\) occurs before the bilateral set \(B_{\theta ,\theta '}\).

We now proceed with the final case, that is \(\theta < \pi \). The monomials are computed using Table 1 with \(i = \theta ,j = \pi \) and \(k = q\).

(Case 2.a): If \(L_{\pi }-L_{\theta }\) is not equal any partial sum, then the multisets \({\text {Mon}}_{2}(L_{\theta },|V|-L_{\pi },L_{\pi }-L_{\theta })\) is the same as (Case 1.a) with the roles of \(\theta \) and \(\pi \) interchanged.

(Case 2.b): Suppose \(L_{\pi }-L_{\theta } = L_q=R_{q'}\) for some \(1 \le q \le \pi \) and \(1 \le q' \le \pi '\). We resolve this case pertaining to the orientation of the bilateral set \(B_{q,q'}\). The colorings from the first four rows of Table 1 contribute the monomials occurring in the multisets.

\(B_{q,q'}\) and \(B_{\theta ,\theta '}\)

\(v_{\pi }v_{\pi +1}\)

\(v_{\pi +1}v_{\pi }\)

 

Right directed

Left directed

Right directed

Left directed

Inward directed

\(\{3yz,z^2\}\)

\(\{2yz,2z^2\}\)

\(\{y^2,yz,2z^2 \} \)

\(\{2yz,2z^2\}\)

Outward directed

\(\{2y^2,2yz\}\)

\(\{2y^2,yz,z^2\}\)

\(\{2y^2,2yz\}\)

\(\{y^2,3yz\}\)

Unison with \(B_{\theta ,\theta '}\)

\(\{y^2,2yz,z^2\}\)

\(\{2y^2,2z^2\}\)

\(\{2y^2,yz,z^2\}\)

\(\{y^2,2yz,z^2\}\)

Not in unison with \(B_{\theta ,\theta '}\)

\(\{3y^2,z^2\}\)

\(\{y^2,2yz,z^2\}\)

\(\{y^2,2yz,z^2\}\)

\(\{y^2,3z^2\}\)

where the multiset \({\text {Mon}}_{2}(L_{\theta },|V|-L_{\pi },L_{\pi }-L_{\theta })\) is computed for the first three rows, and the last row corresponds to the multiset \( {\text {Mon}}_{2}(L_{\theta },L_{\pi }-L_{\theta },|V|-L_{\pi })\).

For fixed orientations of \(\{v_{\pi },v_{\pi +1}\}\) and \(B_{q,q'}\), the multisets corresponding to \(B_{\theta ,\theta '}\) being right directed and left directed are distinct. Therefore the orientation of \(B_{\theta ,\theta '}\) can be reconstructed. This completes the proof. \(\square \)

The following corollary is an immediate consequence of the above Proposition.

Corollary 14

The orientations of paths can be reconstructed from their quasisymmetric B-function up to isomorphism.

Proof

We associate the integer composition \((1,1,\dots ,1)\) of length |V| to the oriented path . The orientations of the bilateral sets \(B_{p,p}\) for \(p=1,2,\dots ,\lfloor |V|/2\rfloor \) can be obtained from (4.8) up to uni-direction. The method for determining the uni-directed bilateral sets is identical to the (Step I) in the proof of Proposition 16. \(\square \)

Even though the non-uni-directed bilateral sets are straightforward to determine from the \({\text {QBF}}\), they cause hindrance in recovering the pendant vectors (see Fig. 7). This imposes the constraint of considering orientations of proper caterpillars in which certain pendant vectors corresponding to inward and outward directed bilateral sets exhibit symmetry.

Definition 15

Let C be a proper caterpillar. An orientation is said to be partially symmetric if for every inward and outward directed bilateral set \(B_{p,p'}\), the pendant vectors \(P(v_{p})\) and \(P(v_{\ell -p'+1})\) are equal. We denote the set of isomorphism classes of partially symmetric orientation of C by \(\mathcal {O}(C)\).

The oriented proper caterpillar in Fig. 4 is a partially symmetric orientation, whereas the oriented caterpillars in Fig. 7 are not. We now prove that the pendant vectors in partially symmetric orientations of proper caterpillars can be retrieved from the \({\text {QBF}}\).

Theorem 16

The partially symmetric orientations of proper caterpillars can be reconstructed from their quasisymmetric B-functions.

Proof

We have already established the reconstruction of spine in Proposition 13. It suffices to prove that the pendant vectors in partially symmetric orientations can be determined by their \({\text {QBF}}\). Let be a partially symmetric orientation of a proper caterpillar C. The idea involves consideration of in-out degree sequence of the digraph, and surjective 3-colorings whose non-monochromatic edges comprise of one spine edge and one pendant edge. In particular, we are examining the multiset \({\text {Mon}}_{}(1,|V|-1)\), and colorings in which the deletion of non-monochromatic edges leads to connected components of sizes either \(1, L_{p}-1\) and \( |V|-L_p\), or \(1, R_{p'}-1\) and \(|V|-R_{p'}\).

We prove by induction on \(s \in \big \{L_p,R_{p'} \;|\; 2\le L_p,R_{p'} \le \lfloor |V|/2\rfloor \text { and } p,p' \ge 1 \big \}\) where the \({\text {Comp}}(C)\) is lexicographically smaller than its reverse. We prove the base step by using the multiset \({\text {Mon}}_{2}(1,|V|-1)\) that encodes the in-out degree sequence of the vertices of degree 2 (see (2.3)). For the base step \(s = 2\), we have either \(s= L_1 \ne R_1\) or \(s = L_1 = R_1\). In the former scenario, \(v_1\) is the unique vertex of degree 2 in C, and therefore the multiset

$$\begin{aligned} {\text {Mon}}_{2}(1,|V|-1) = {\left\{ \begin{array}{ll} \{y^2\} &{} \text { iff } v_1v_2 \in A \text { and } P(v_1) = (1,0), \\ \{z^2\} &{} \text { iff } v_2v_1 \in A \text { and } P(v_1) = (0,1), \\ \{yz\} &{} \text { otherwise.} \end{array}\right. } \end{aligned}$$

In the latter case, \(v_1\) and \(v_{\ell }\) are the only vertices of degree 2, and we have four possibilities for the orientation of \(B_{1,1}\). The following computation table depicts that in all four cases, the multiset \({\text {Mon}}_{2}(1,|V|-1)\) encoding the in-out degree of \(v_1\) and \(v_{\ell }\) distinguishes the occurrences of the pendant vectors of \(P(v_1)\) and \(P(v_{\ell })\) in partially symmetric orientations.

Orientation of bilateral set \(B_{1,1}\)

 

Right directed

Left directed

Inward directed

Outward directed

\({\text {Mon}}_{2}(1,|V|-1)\)

\(P(v_1)\)

\(P(v_{\ell })\)

\(P(v_1)\)

\(P(v_{\ell })\)

\(P(v_1)\)

\(P(v_{\ell })\)

\(P(v_1)\)

\(P(v_{\ell })\)

 

(1, 0)

(0, 1)

(0, 1)

(1, 0)

    

\(\{y^2,z^2\}\)

(1, 0)

(1, 0)

(1, 0)

(1, 0)

    

\(\{y^2,yz\}\)

(0, 1)

(0, 1)

(0, 1)

(0, 1)

    

\(\{yz,z^2\}\)

(0, 1)

(1, 0)

(1, 0)

(0, 1)

(0, 1)

(0, 1)

(1, 0)

(1, 0)

\(\{2yz\}\)

    

(1, 0)

(1, 0)

  

\(\{2y^2\}\)

      

(0, 1)

(0, 1)

\(\{2z^2\}\)

Assume by induction that we already have the knowledge of the pendant vectors \(P(v_q)\) and \(P(v_{\ell -q'+1})\) for \(L_q, R_{q'} < s\). Now, consider the case where \(s = L_p = R_{p'}\). According to Observation 9, we deduce that the set of non-monochromatic edges of the colorings in \(F_C(s-1, |V|-s, 1)\) are \(\big \{ \{v_p,v_{p+1}\}, \{v_q,u_{qi}\} \big \}\) or \(\big \{ \{v_{\ell -p},v_{\ell -p+1}\}, \{v_{\ell -q'+1},u_{\ell -q'+1\,i}\} \big \}\) for \(q = 1,2,\dots ,p\) and \(q' = 1,2,\dots ,p'\). Let \([y^2],[z^2]\) and [yz] denote the multiplicity of \(y^2,z^2\) and yz in \({\text {Mon}}_{2}(s-1,|V|-s,1)\) respectively. Then, the partial sums of pendant vectors are given by:

$$\begin{aligned} {} \sum _{k=1}^{p}P(v_k)&= {\left\{ \begin{array}{ll} ([y^2],s-p-[y^2]) &{} \text {if } B_{p,p'} {\text { is right directed}}, \\ (s-p-[z^2],[z^2]) &{} \text {if } B_{p,p'} {\text { is left directed}}. \end{array}\right. } \end{aligned}$$
(4.10)
$$\begin{aligned} {} \sum _{k=1}^{p'}P(v_{\ell -k+1})&= {\left\{ \begin{array}{ll} (s-p'-[z^2],[z^2]) &{} \text {if } B_{p,p'} {\text { is right directed}}, \\ ([y^2],s-p'-[y^2])&{} \text {if } B_{p,p'} {\text { is left directed}}. \end{array}\right. } \end{aligned}$$
(4.11)
$$\begin{aligned} {} \sum _{k=1}^{p}P(v_k)+ \sum _{k=1}^{p'}P(v_{\ell -k+1})&= {\left\{ \begin{array}{ll} ([y^2],[yz]) &{} \text {if } B_{p,p'} {\text { is inward directed}}, \\ ([yz],[z^2])&{} \text {if } B_{p,p'} {\text { is outward directed}}. \end{array}\right. } \end{aligned}$$
(4.12)

This implies that we can determine both \(P(v_p)\) and \(P(v_{\ell -p'+1})\) when \(B_{p,p'}\) is uni-directed. On the other hand, if \(\{v_{p},v_{p+1}\}\) and \(\{v_{\ell -p'},v_{\ell -p'+1}\}\) are not bilateral edges, then (4.10) and (4.11) can be used to derive the pendant vectors of \(P(v_{p})\) and \(P(v_{\ell -p'+1})\) as well. However, when \(B_{p,p'}\) is not uni-directed, we can extract \(P(v_p)+P(v_{\ell -p'+1})\), and therefore compute the pendant vectors of both vertices \(v_p\) and \(v_{\ell -p'+1}\) when is a partially symmetric orientation. Note that if \(|V|/2 \notin \{L_p\}_{p=1}^{\ell }\), then there exist a unique spine vertex \(v_t\) such that \(L_{t-1} \le \lfloor |V|/2\rfloor < L_t\) (For example, in Fig. 4, the partial sum \(L_3 \le 8 < L_4\)). The equations mentioned above cover the computation of all pendant vectors except for \(P(v_t)\). Nonetheless, we can determine this pendant vector by subtracting \(\sum _{k \in [\ell ]\setminus \{t\}}I_k\) and \(\sum _{k \in [\ell ]\setminus \{t\}}O_k\) from the multiplicity of y and z in the degree multiset \({\text {Mon}}_{}(1,|V|-1)\), respectively. Thus, the orientation of can be reconstructed from the \({\text {QBF}}\) up to isomorphism. \(\square \)

4.2 Asymmetric Proper Caterpillars

Recall the Definition 5(b) of asymmetric proper caterpillars, which dictates that the components of their associated composition must be distinct. We show that all oriented asymmetric proper caterpillars can be reconstructed from their \({\text {QBF}}\)s. We use the fact that no more than two pairs of non-pendant vertices can have the same degree. Consequently, we can sequentially compute the pendant vectors by removing the terms contributed by the spine arcs connected to each spine vertex.

Theorem 17

Let be an oriented asymmetric proper caterpillar. Then can be reconstructed from its quasisymmetric B-function up to isomorphism.

Proof

Without loss of generality, we assume that \({\text {Comp}}(C) = (\alpha _1,\alpha _2,\dots ,\alpha _{\ell })\) is lexicographically smaller than its reverse. For \( i = 1,2,\dots ,\ell \), let \(h_i\) be the coloring in \(F_C(1,|V|-1) \) that assigns the unique color 1 to the spine vertex \( v_i \). Thus, we have

$$\begin{aligned} {} {\textit{m}}_{h_i} {:}{=}y^{ asc (h_i)}z^{ dsc (h_i)} = y^{ outdegree \, of \, v_i }z^{ indegree \, of \, v_i } \end{aligned}$$
(4.13)

From Proposition 13, the orientation of spine of is known. This implies that the above monomials can be computed from the pendant vector of the vertices. On the other hand, the internal vertices can be identified with their unique corresponding monomials due to the equality of degree, and the pendant vector of such vertices can be retrieved by the following:

$$\begin{aligned} {} P(v_i) = {\left\{ \begin{array}{ll} (\deg _y\dfrac{{\textit{m}}_{h_i}}{y^2}, \deg _z\dfrac{{\textit{m}}_{h_i}}{y^2}) &{} \text {if } v_{i}v_{i-1},\,v_{i}v_{i+1} \in A, \\ (\deg _y\dfrac{{\textit{m}}_{h_i}}{z^2}, \deg _z\dfrac{{\textit{m}}_{h_i}}{z^2}) &{} \text {if } v_{i-1}v_{i},\,v_{i+1}v_{i} \in A, \\ (\deg _y\dfrac{{\textit{m}}_{h_i}}{yz}, \deg _z\dfrac{{\textit{m}}_{h_i}}{yz}) &{} \text {otherwise.} \end{array}\right. } \end{aligned}$$
(4.14)

Due to asymmetry of the caterpillar, all the monomials in \({\text {Mon}}_{}(1,|V|-1)\setminus \{m_{h_{1}},m_{h_{\ell }}\}\) have distinct total degrees. Consequently, we can easily identify the corresponding internal vertices and compute their pendant vectors using (4.14). Therefore it suffices to compute the pendant vertices \(P(v_1)\) and \(P(v_{\ell })\). Note that \(\alpha _1 \ne \alpha _{\ell }\) implies that \(\{v_1,v_{2}\}\) is not a bilateral edge, allowing us to compute \(P(v_1)\) from Theorem 16. Furthermore, the pendant vector for \(P(v_{\ell })\) can be determined using Theorem 16, except when a non-uni-directed bilateral set \(B_{k,1}\) exists. However, when there exists a non-uni-directed bilateral set \(B_{k,1}\), we use (4.12) to determine the partial sum \(P(v_{\ell }) + \sum _{i=1}^{k} P(v_i)\). Since the \(P(v_1)\) is known, and the degree of the internal vertices \(v_2,v_3,\dots ,v_{k}\) are less than \(\deg (v_{\ell })\), their corresponding monomials in \({\text {Mon}}_{}(1,|V|-1) \setminus \{m_{h_1}\}\) can be identified. This enables us to compute the pendant vectors of the internal vertices \(v_2,v_3,\dots ,v_{k}\), and as a result, the pendant vector \(P(v_{\ell })\) can be computed as well. This completes the proof. \(\square \)

5 Future Prospects

Partially symmetric orientations constitute a large class of orientations for proper caterpillars. Furthermore, for each proper caterpillar and its non-partially symmetric orientation (up to isomorphism), we can associate distinct partially symmetric orientations (up to isomorphism) by replacing inward and outward directed bilateral sets with right and left directed bilateral sets, respectively. In other words, partially symmetric orientations constitute more than half of the orientations for proper caterpillars. Moreover, for certain proper caterpillars, every orientation is partially symmetric. Examples include caterpillars with associated compositions (4, 4), (2, 3, 3) and (2, 2, 4).

However, the statistics discussed in Sect. 4 are insufficient to distinguish non-partially symmetric orientations. Figure 7 exhibits two non-isomorphic oriented proper caterpillars for which the statistics discussed in the proofs of Theorem 16 are equal, but their corresponding \({\text {QBF}}\)s are distinct.

Fig. 7
figure 7

Two non-isomorphic graphs having the same in-out degree sequence, height-profile and aforementioned statistics

Also, we do not know how to distinguish partially symmetric orientations from non-partially symmetric orientations. Nevertheless, we believe that the method to distinguish these two types of orientations will shed light on reconstructing the non-partially symmetric orientations. We would like to highlight that the proof was based on examining monomials of degree at most 2 of surjective 3-colorings and the degree-multiset. Moreover, the methods used in Proposition 13 and Theorem 16 can be applied to determine the partial orientation of trees in which vertices with a degree of at least 3 induce a path. In particular, certain orientations of proper q-caterpillars [17], introduced by the author and others, can be reconstructed from their \({\text {QBF}}\)s. Computational evidence suggests that the higher degree terms can distinguish the non-partially symmetric orientations, but providing their combinatorial interpretation with respect to the caterpillar is a tedious task. As mentioned earlier, the challenge in studying non-proper caterpillars lies in dealing with the presence of pendant arcs while investigating the orientation of the spine. However, we hope that one may overcome this obstacle by considering the examination of various coefficients together.

Note that the B-polynomial of a digraph D and its reverse \( rev (D)\) are the same. Investigating the uniqueness of B-polynomials of digraphs up to isomorphism and reversal is an interesting question worth exploring.

Question 18

Does the B-polynomial distinguish acyclic digraphs up to isomorphism and reverses?

The computations using SageMath affirm the question above for oriented trees up to order 8.

Next, we pose a conjecture regarding identification of self-reverse (digraphs satisfying \(D \simeq rev (D)\)) digraphs by their \({\text {QBF}}\)s. It is evident from the definition that the quasisymmetric B-functions of both D and \( rev (D)\) satisfy \(B_{D}(\mathrm {\textbf{x}};y,z) = B_{ rev (D)}(\mathrm {\textbf{x}}; z, y)\). Consequently, when the digraph D is self-reverse, we have

$$\begin{aligned} {} B_{D}(\mathrm {\textbf{x}};y,z) = B_{ rev(D) }(\mathrm {\textbf{x}}; y, z) = B_D(\mathrm {\textbf{x}}; z, y). \end{aligned}$$
(5.15)

This implies that the quasisymmetric B-function of self-reverse digraphs is symmetric with respect to the variables y and z, or equivalently, it can be expressed as a function of \(\mathrm {\textbf{x}}\), \(y + z\), and yz. This observation leads to the following conjecture:

Conjecture 19

The quasisymmetric B-function of digraph D is symmetric with respect to the variables y and z if and only if D is isomorphic to the digraph \( rev (D)\).

Observe that the characterizing properties of self-reverse proper caterpillars are (a) the underlying caterpillar is a palindrome, (b) all the bilateral sets are uni-directed and (c) the pendant vector \((O_k,I_k) = (I_{\ell -k+1},O_{\ell -k+1})\) for all \(k=1,2,\dots , \lceil \ell /2\rceil \). The proof of Theorem 16 demonstrates the equivalence between the symmetry of variables y and z, and the conditions mentioned above. This implies the validity of the Conjecture 19 for oriented proper caterpillars and paths.

The methods used to prove Theorems 16 and 17 relied on the assumption that the underlying graph is a tree. An intriguing avenue of research would be to explore these questions in the context of non-tree graphs, particularly Question 4. In [13], various classes of unicyclic graphs, such as asymmetric crabs and squids, were shown to be distinguishable by chromatic symmetric functions. We believe that our methods hold the potential to provide insights into the reconstruction of orientations of these unicyclic graphs. For example, given a fixed asymmetric crab containing a directed cycle, its orientations can be uniquely determined by the in-out degree sequence (and using (4.14)).

Regarding the study of equality of quasisymmetric B-function, the construction of non-isomorphic graphs with equal Tutte symmetric function in [18] leads to the following non-isomorphic digraphs with equal quasisymmetric B-function (verified using SageMath). Moreover, these digraphs contain a unique pair of opposite arcs.

Fig. 8
figure 8

Non-isomorphic digraphs with the same quasisymmetric B-function and containing a unique directed cycle

We conclude with the following questions regarding digraphs with equal quasisymmetric B-functions.

Question 20

Does there exist

  1. (a)

    infinitely many pairs of non-isomorphic digraph containing a unique directed 2-cycle and equal quasisymmetric B-function?

  2. (b)

    pair of non-isomorphic digraphs without containing a 2-cycle and equal quasisymmetric B-function?