With parliament gridlocked on a Brexit deal, and time running out before the 29 March deadline, there is increasing focus on a second referendum.

Much of the attention so far has focused on the politics of the idea, but there are also complex logistical challenges. Below are the decisions which would have to be made, and hurdles cleared, if there was to be such a vote.

How would a second referendum be called?

It would need new primary legislation, as with the EU Referendum Act 2015, which began the whole process. As well as laying down the legal framework for a second referendum, this would need to spell out details such as the question, the poll date and who would be allowed to vote. The bill can say that some details, such as the date, will be specified later by parliamentary directive.

Under the law which lays out rules for such votes, the Political Parties, Elections and Referendums Act 2000, the Electoral Commission also has to carry out what is called “question testing” – making sure the question asked of voters is the best one.

How long would all this take?

The most thorough assessment of the mechanics of a second Brexit referendum, produced by academics at the constitution unit of University College London, concluded the briefest feasible gap between deciding on such a vote and holding it was 22 weeks. This means a poll date of late May at the earliest.

The calculation is that legislation would take 11 weeks: with eight weeks of question testing taking place at the same time; a week for transition between the legislation coming into force and the campaign; and then a 10-week campaign.

Another report into a second referendum, by the People’s Vote group, gives no equivalent figure but argues it should be possible to “condense” elements of the process.

Would article 50 have to be suspended?

Almost inevitably. The official timetable still lays out a UK departure of 29 March, and there will seemingly not be time to hold another public vote before then. Luckily for proponents of a second referendum, the European court of justice ruled last week that the UK can stop the process without seeking EU approval.

Any other timing complications?

The main one would be the next European parliament elections in late May. Even if a decision to hold a second referendum was made in January, a 22-week timetable would take it beyond this date. Assuming remain was an option, this would create a quandary: elect new MEPs who may serve only for a month or so; or don’t hold elections and potentially leave the UK in the EU without representation.

What questions could be on the referendum paper?

This is where it gets complicated, again. There are four possible options to be sorted: leave under the deal set out; leave with no deal; seek a new negotiation to leave; or stay in the EU.

This then opens up several permutations of two-option questions, many of which would be unpalatable either to remainers (the government’s deal or no deal) or to leavers (the government’s deal or remain).

Some MPs are therefore pressing for a multi-option referendum, whereby voters could, for example, pick between the government’s deal, no deal, or staying in the EU. It would also be possible to have two successive single-question votes, for example first asking if people accept or reject the deal, and if they decline it, whether they would then prefer no deal or staying in the EU. All these entail extra complications, not least on timing.

How would the votes be counted?

This is something which has received relatively little attention so far but, as the UCL paper notes, could play a crucial role.

Referendums are traditionally first past the post, which means that even if opinion is starkly divided – such as the 52% to 48% of the first EU referendum – the winner takes all. This could become even more glaring if there were three options: in a close vote between a deal, no deal or remain, the country’s future for decades could be set by fewer than 40% of the ballots, when another option could be a better consensus.

Another option is the alternative vote (AV), whereby voters have a second vote which is counted if no option gets 50% or more of first preferences and their first choice is knocked out.

This can help decide multi-option polls, but can have complications, not least the risk of eliminating what political scientists call the “condorcet winner” – the choice which if, paired one-to-one with any other option, would be the majority choice.

To take one example, it could be possible for the government’s deal to be the overall consensus choice, more popular than both no deal and remain when paired against each, but to not make the final round as the other two have slightly more die-hard supporters.