Added isConnected Method to QueryGraph