The House of Commons continues to struggle to break the Brexit deadlock.

MPs have rejected the UK's withdrawal agreement with the EU three times and have twice voted down all the alternative options put forward.

An explanation for this stalemate can be found not only in MPs' deeply-held and divergent views on Europe but also in the fluid political make-up of the House of Commons.

What was the situation in 2017?

Image copyright PA Image caption The DUP have supported the Conservatives since 2017 but will their agreement survive Brexit?

No political party won a majority at the 2017 election, which resulted in a Hung Parliament.

After the poll, the Conservatives agreed a parliamentary pact - officially known as a confidence and supply agreement - with the Democratic Unionists.

This arrangement gave Theresa May's government an overall majority of six - in other words, the Tories and DUP had six more MPs elected than all the other parties combined.

But in reality it had what is called a working majority of 13. That's because Sinn Fein - which currently has seven MPs - historically does not take up its seats.

Excluding Commons Speaker John Bercow and his non-voting deputies, Tory Eleanor Laing and Labour's Lindsay Hoyle and Dame Rosie Winterton, Theresa May has typically needed to get the backing of 320 MPs to get a majority in Commons votes.

For the first year or so, the government got its legislation through Parliament quite comfortably but as Mrs May has found to her cost, things have become much more problematic in recent months.

What's changed?

Image copyright AFP Image caption Anna Soubry (centre) and Sarah Wollaston (right) are among those to have left the Conservatives

The government's already slim working majority - the smallest of any new government since the 1970s - has been further whittled down this year.

In January, three Conservative members of Parliament - Sarah Wollaston, Heidi Allen and Anna Soubry - quit the party to join the Independent Group of MPs.

Then on Monday, former minister Nick Boles resigned the Conservative whip over Brexit and said he would be sitting as an Independent Progressive Conservative.

What's the current state of play?

Image copyright AFP Image caption Labour has suffered its own casualties - losing more than a dozen MPs

As it stands, Theresa May currently has a working majority of six. This will fall to five if Labour wins the Newport West by-election on Thursday.

The seat has been vacant since the death of Paul Flynn in February. Labour has held the seat since 1987 and Mr Flynn re-gained it with a majority of 5,658 two years ago.

The Conservatives are still the largest party by far in the House of Commons, with 312 MPs.

Their direct numerical lead over Labour, the second largest party, has actually grown since 2017. After the last election, it stood at 55 seats. Now it is 68.

That's because Labour, which currently has 243 MPs, has suffered a slew of defections of their own.

Eight of their MPs left to join the Independent Group while another five - Ivan Lewis, John Woodcock, Jared O'Mara, Frank Field and Ian Austin - have quit the party for a variety of reasons and are now sitting as independents.

Fiona Onasanya was expelled after being jailed for perverting the course of justice while Kelvin Hopkins and Chris Williamson are currently suspended pending internal inquiries into their conduct.

What does this mean for Brexit?

With the DUP opposed to her agreement and Tory MPs increasingly prepared to defy the whip, Theresa May has no real majority to speak of for her Brexit policy.

As well as the three defeats on the withdrawal agreement, the government has been left red-faced on numerous other occasions, even losing control of the House during the indicative votes process.

When it has won key votes, it has often only done so by the skin of its teeth.

The government is opposed by a broad coalition of Labour, SNP, Lib Dem, Plaid Cymru and Green MPs who are pushing for a different kind of exit, or who want to remain in the EU.

While some of the newly-independent MPs, including ex-Liberal Democrat Stephen Lloyd, have sided with Mrs May over Brexit, most have not while the Independent Group has voted as a bloc against the PM.

What does this mean for a confidence vote?

Jeremy Corbyn tabled a no-confidence motion in the government in January, shortly after its first defeat on Theresa May's Brexit deal.

Every single Conservative MP at the time supported the government, as did the Democratic Unionists, as the government survived by a margin of 325 to 306 votes.

But the result could be a lot closer if the Labour leader chooses to repeat the exercise again.

Not only do the Conservatives have fewer MPs but leading Tory Brexiteers have warned the PM their support cannot be taken for granted if they think the future of Brexit is under threat.

And the DUP have said they will use all means to oppose the withdrawal agreement in its current form.