Wolfram Function Repository
Instantuse addon functions for the Wolfram Language
Function Repository Resource:
Determine whether a Wolfram model rule is leftconnected
ResourceFunction["ConnectedWolframModelQ"][rule] yields True if the lefthand side of the rule is connected, and the righthand side is connected to the lefthand side. 

An example of a connected rule:
In[1]:= 

Out[1]= 

An example of a disconnected rule:
In[2]:= 

Out[2]= 

Multiple rules are supported:
In[3]:= 

Out[3]= 

In[4]:= 

Out[4]= 

Unary edges are supported:
In[5]:= 

Out[5]= 

In[6]:= 

Out[6]= 

In[7]:= 

Out[7]= 

By default, the righthand side is allowed to be disconnected:
In[8]:= 

Out[8]= 

Left and right hand sides should be connected to each other:
In[9]:= 

Out[9]= 

While the righthand side can be disconnected, each piece must be connected to the lefthand side:
In[10]:= 

Out[10]= 

One can also require the righthand side to be connected separately:
In[11]:= 

Out[11]= 

This work is licensed under a Creative Commons Attribution 4.0 International License