The good people of Edinburgh City Centre are going to the polls today to vote for a replacement for the SNP’s US-bound David Beckett. Not only does this by-election have the potential to overturn the knife-edge SNP-Lib Dem local coalition (wouldn’t it be lovely to have an administration that pulls in one direction?), but it’s a true psephological oddity, as others have observed.

In 2007, this was (as far as I know) Scotland’s only five-way marginal, as follows.

Party 1st preferences 1st prefs share
SNP 1630 20.4%
Conservative 1614 20.2%
Lib Dem 1587 19.9%
Labour 1437 19.0%
Green 1352 18.0%
SSP & others 355 4.4%

It’s a three-member ward, and the SNP, the Tories and the Lib Dems all returned a councillor. Under STV, though, the results were pretty complicated to generate, and it took the elimination of my friend Gavin, the Green candidate, before anyone was elected – the Lib Dem Charles Dundas – with the SNP’s David Beckett elected next, and the Tories’ Joanna Mowat only returned once Labour’s Bill Cunningham was finally eliminated in the last round.

The narrowness runs throughout, though. Gavin was the first of the top five contenders to be eliminated, but at that stage we were just 18 votes behind Labour. If ten of the fourteen SSP voters who put Labour second had gone Green with their second preference, Labour would have lost out earlier and we’d almost certainly have seen a Green elected (and we wouldn’t have had three years of this specific and singularly inept local administration either).

It’s hard to tell from the Council’s own documentation, which (given Labour were eliminated last) doesn’t show how Labour voters’ second preferences would go. But the final page of that document does show the aggregate of where each candidate was across all ballots, and that’s pretty revealing. Of the top five candidates, the Lib Dems were (in 2007, probably not now!) the most transfer-friendly, followed closely by the Greens. Both the Lib Dems and the Greens had more second preferences than first preferences, despite that close tie at the top – none of the other large parties came close. Labour were the third most transfer-friendly, some distance away, clearly ahead of the SNP, with the Tories showing the sharpest drop-off, with barely a third as many people prepared to give them a second preference.

That illustrates why the Lib Dems were elected first despite being third on first prefs, although the other table shows exactly how that happened. Green first preferences (and the hundred or so we’d picked up from the small parties) broke predominantly for the Lib Dems, then the SNP, then Labour. The Tories struggled over the line as the last to elect a councillor because they’re very few people’s second preference party. In fact, Labour had made up to within six and a bit votes of them by the end, but it was just not enough.

Today’s election will be effectively under AV, like all Scottish local by-elections since May 2007. Number crunchers out there who thought May’s referendum disappointment meant we’d never get to test that system – fret not. Since 2007, the SNP’s position has strengthened and the Lib Dems’ weakened, although the SNP have picked a candidate who seems to play very badly at hustings. There’s a local single-issue anti-tram candidate, too, John Carson, but he’ll probably just be a staging point for some SNP and Tory voters before they head home.

I’ll eat a specially-made spaghetti hat if the Lib Dems aren’t the first of the Big Five to be eliminated, and then (as at Holyrood) I’d expect Melanie Main for the Greens to pick up most of their second preferences too. That’d be a nice indication of the accuracy of the idea that Lib Dem voters switched straight to the SNP at Holyrood – my view is that the Lib Dems leaked to Labour on the first vote and Labour leaked to the SNP, plus differential turnout made a massive difference.

My expectation is that either the Tories or Labour will be next to fall – the Tories for not picking up enough second preferences, or Labour for not having won enough first preferences to begin with, with the Tories favourite to go. By this stage we’re down the rabbit-hole and anything can happen, but there’s a logic to Tony’s argument that the Greens have the best chance of beating the SNP. Whoever wins, though, there are definitely prizes for silver and bronze. The last two candidates eliminated will be best placed to win the other two seats elected in May next, so every vote really will count here today.

It’s also during the month when the city has its mind on other things, to say the least, and when many of the electorate will be away on holiday. But it really matters. An SNP or (implausible as it sounds) Lib Dem win would keep the current administration in office. A Green, Labour or Tory win would remove their casting-vote majority.

So there you have it. A complex five-way marginal, conducted under AV, which could determine who runs the nation’s capital for the eight months or so until we do it all again. {proper bias starts here} Best of luck to Melanie Main and the hardest working Green local team I’ve ever seen, who’ve been doorstepping enthusiastically in all weathers – you deserve a fantastic result.