The resignation of Labor's David Feeney sets up the electorate of Batman as a major test of strength between the Labor Party and the Greens.

For more than a decade, the Greens have made major advances against Labor in inner-Melbourne electorates that were once Labor bastions.

It is a trend driven by demography. Waves of 'gentrification' have changed the face of inner-city electorates where the population was once predominantly working class and significantly overseas born.

Once undesirable inner-city residences have become more valuable and fashionable through their proximity to the city and universities.

The new residents moving into inner-city seats are overwhelmingly university educated, professionally employed, non-religious and affluent.

Where once such voters would have been thought of as natural Liberals, the new residents of Labor's former working class seats are strongly attracted to voting Green.

The political impact is clear when you compare Labor's vote across Victoria to its results in inner-Melbourne.

Labor's first preference vote share has declined nine percentage points across Victoria since Labor's victory at the 2007 Federal election. Around half of that vote has been lost to the Greens.

The loss of Labor vote has been much more dramatic in inner-Melbourne. Labor's first preference vote share has fallen 25 percentage points in Melbourne, 26 in Wills, 22 in Batman, 15 in more marginal Melbourne Ports, and even 16 percentage points in Liberal held Higgins.

For all the finger pointing at the qualities of David Feeney as sitting member, the trend from Labor to the Greens in Batman is little different to the same trend in neighbouring inner-city seats.

Labor lost the seat of Melbourne to the Greens' Adam Bandt in 2010 on Liberal preferences. Since then the Liberal Party has reversed its preference strategy and now recommends Liberal voters give preferences to Labor.

Liberal preferences could not stop Bandt being re-elected in 2013, and were of no use to Labor in Melbourne in 2016 when the Labor candidate slipped to third place.

Liberal preferences saved Labor in Batman in 2016, and probably in neighbouring Wills. But Liberal preferences are of no help if Labor's first preference vote keeps falling.

Given the Liberal Party is unlikely to nominate a candidate, Liberal preferences can't save Labor at the Batman by-election. The lack of a Liberal candidate played a significant role in three previous Labor losses to the Greens at by-election. These were the Federal seat of Cunningham in 2002, WA state seat of Fremantle in 2009, and last November's loss in the Victorian state seat of Northcote. Northcote covers the southern half of Batman.

The graph below shows the dramatic decline in Labor first preference vote share in each of the five inner-Melbourne seats since 1998. For reference, Labor's Victorian first preference vote share is shown, as well as results for the inner-Sydney seat of Grayndler where Labor has also been challenged by the Greens.

All the inner-Melbourne electorates have shown the same trend since 2007, a decline steeper than for Victoria as a whole, and the same in Batman as in neighbouring electorates.

The same trend has afflicted state Labor seats since 2002, losing the state seat of Melbourne in 2014, and losing Northcote (which takes in the southern half of Batman) at a by-election November 2017. The Greens gained Prahran at the 2014 state election, a more complex three way marginal seat, and Labor remains under challenge in Richmond and Brunswick.

So the finger pointing at David Feeney just ignores that the trend has continued for a decade in all inner-Melbourne seats. Labor has spent a fortune trying to hang on in Melbourne seats, but to date there has been no sign of the trend to the Greens reversing.

Figures for the inner-Sydney seat of Grayndler have been included because its trend has been different despite Grayndler sharing many of the demographic characteristics of inner-Melbourne.

Why has the trend against Labor in Grayndler stalled? One answer is candidates. Grayndler has been held by high-profile Labor frontbencher Anthony Albanese. He grew up in the area, his wife is a former NSW Deputy Premier and member for the local state seat, and he maintains a strong local presence despite the pressure of holding a senior frontbench position.

He has also been assisted by the Greens' choice of candidate. Both Hall Greenland in 2013 and Jim Casey in 2016 were on the far left of Australian politics.

There are also differences in Greens' party structure north and south of the Murray.

The NSW Greens are more decentralised, with local branches having much more say over choice of candidate and style of campaign. Crucially, most election funding is handed to local branches.

The Victorian Greens have a more centralised structure and election funding goes to the state branch. The Victorian Greens have chosen to direct more financial and human resources to specific lower house seats where the party thinks it can win.

In NSW, attempts to adopt a similar strategy are stymied by the local branch structure of the party.

Green support in all states has declined since the party's high point from 2008 to 2010. There are several reasons.

The party has faced new competition from parties such as Animal Justice and the Sex Party (now Reason Party).

The increase in candidates contesting elections, plus Liberal attacks on the Greens as left-wing, may have diminished the party's appeal as a protest against the major parties. The increasingly strong flow of Green preferences to Labor in recent elections suggests the Greens have lost middle-ground votes.

Concentrating resources on lifting vote in winnable seats may have also stalled any increase in state-wide vote, though the trend has been no different in NSW where party financial resources are spread more evenly.

Yet the Greens continue to be different from previous new parties in having a clearly identifiable demographic base, for the Greens it being amongst younger university educated voters.

The geographic concentration of that demographic base is also a key reason why the Greens have been able to win lower house seats, something that was largely beyond parties such as the Democratic Labor Party and Australian Democrats.

The problem for the Labor Party is that demographic change is putting Green voters in high concentrations in inner-city seats that were once Labor heartland.

How does Labor straddle the divide between inner-city voters wanting more radical policies, and the sort of outer-suburban voters that decide the battle between Labor and the Coalition, but where support for the Greens is low?

Batman will be another round in the battle between Labor and the Greens. Labor has hung on grimly through the previous rounds, but still lacks a strategy to get off the ropes and launch a counter attack.