This paper represents a step in our program towards the proof of the Pierce--Birkhoff conjecture. In the nineteen eighties J. Madden proved that the Pierce-Birkhoff conjecture for a ring A$is equivalent to a statement about an arbitrary pair of points $\alpha,\beta\in\sper\ A$ and their separating ideal $<\alpha,\beta>$; we refer to this statement as the Local Pierce-Birkhoff conjecture at $\alpha,\beta$. In this paper, for each pair $(\alpha,\beta)$ with $ht(<\alpha,\beta>)=\dim A$, we define a natural number, called complexity of $(\alpha,\beta)$. Complexity 0 corresponds to the case when one of the points $\alpha,\beta$ is monomial; this case was already settled in all dimensions in a preceding paper. Here we introduce a new conjecture, called the Strong Connectedness conjecture, and prove that the strong connectedness conjecture in dimension n-1 implies the connectedness conjecture in dimension n in the case when $ht(<\alpha,\beta>)$ is less than n-1. We prove the Strong Connectedness conjecture in dimension 2, which gives the Connectedness and the Pierce--Birkhoff conjectures in any dimension in the case when $ht(<\alpha,\beta>)$ less than 2. Finally, we prove the Connectedness (and hence also the Pierce--Birkhoff) conjecture in the case when dimension of A is equal to $ht(<\alpha,\beta>)=3$, the pair $(\alpha,\beta)$ is of complexity 1 and $A$ is excellent with residue field the field of real numbers.