In Greek legend, Sisyphus was doomed in hell perpetually to push a boulder up a hill. Whenever he neared the top, the boulder would slip from his grasp and roll to the bottom again. Algeria's Sisyphus is Chakib Khelil, its former energy minister who was burdened not by one boulder but three: a stagnant state-dominated economy, the old guard of political heavyweights, and the immovable mass of global energy markets.
Mr Khelil's exit in May has not solved these problems. On the contrary: last week's launch of the latest bidding round for new oil and gas exploration, and growing worries about who will succeed the president, Abdelaziz Bouteflika, make them more pressing than ever. The former oil minister was ostensibly removed over a corruption scandal. Though he was not accused of any crime, an alleged embezzlement of hundreds of millions of dollars relating to engineering and procurement contracts took place on his watch.
Mr Khelil's protege Mohamed Meziane, the chief executive of the state oil company Sonatrach, was the most prominent of those sacked and arrested. Mr Khelil was a surprising choice when he became energy minister in 1999. During 20 years with the World Bank in Washington he had concentrated on reforms in Latin America. He at once promoted a liberalising agenda, trying to convert Sonatrach from a state entity into a truly commercial company, and even proposing that it could one day be privatised.
He hurried up the interminable process of awarding new acreage to international companies. He introduced an independent regulator, Alnaft, to oversee the oil sector. And under his leadership, in partnership with international companies such as BP, new areas in the south were developed and Algerian gas production rose significantly. The country enhanced its role as a key supplier to southern Europe, and a welcome alternative to European dependence on Russia.
But in the later years of his tenure, the minister's reformist agenda ran into trouble. The devastating 2004 explosion at the Skikda liquefied natural gas (LNG) plant dented not only plans for increased exports, but also Sonatrach's reputation for competence. Mr Khelil's initiatives foundered on opposition from the public, the unions, Sonatrach itself, and "Le Pouvoir", a powerful clique of generals who made their reputation in the war of independence against France, and then in the 1990s civil war against Islamist insurgents. Ownership of natural resources is a pillar of Algerian nationhood, as for so many other petroleum-rich states.
His more liberal hydrocarbons law, introduced in 2005, was reversed only a year later to give Sonatrach a majority stake in all new licences, and to impose a windfall tax when oil prices rose above US$30 a barrel. Sonatrach began to ask that foreign companies offered overseas assets in return for the rights to invest in Algeria. When oil prices slumped in late 2008, international oil corporations decided they had better prospects elsewhere - the bid round in December that year was a disaster, with only four out of 16 offered areas being awarded.
Worse still, Sonatrach, repeating a similar mistake from the 1980s, had moved away from signing long-term contracts to benefit from high prices, only to be stranded when recession in Europe hammered gas markets and prices slumped. At Oran in April this year, Mr Khelil was reduced to asking the Gas Exporting Countries Forum for a co-ordinated production cut. Embarrassingly, his motion was not even tabled.
Reform in other sectors of the economy had already ground to a halt. During the early 2000s, the country took advantage of higher oil prices to pay off most of its foreign debt, establish a sovereign wealth fund and bring unemployment down from an appalling 30 per cent to a still high, but more tolerable, 10 per cent. Abdelhamid Temmar, the minister for industry and investment promotion, put more than a thousand state companies up for sale, including banks, Algerie Telecom and the national airline, Air Algerie. This could have strengthened Algeria's feeble stock exchange, which has only two listed companies.
But from 2005, the powerful military establishment pressured Mr Bouteflika to end the privatisation programme. Now it seems they have won their battle: Mr Temmar, like Mr Khelil a strong ally of Mr Bouteflika, had to step down at the same time. Encouraging transparency and efficiency, and ending monopolies ironically threatened the entrenched power of the elite and put both men in the firing line.
Of these elite, few are more powerful than Mohamed "Tewfiq" Mediene, the head of the department of internal security (DRS), which led the Sonatrach investigation. As the Algerian blogger The Moor Next Door notes, Sonatrach may now virtually have become a DRS fiefdom. Its capture is part of intra-elite jostling for position in the succession to Mr Bouteflika, now 73 and subject to rumours of failing health.
Algeria needs to enhance the efficiency of its energy sector and eliminate suffocating bureaucracy. Mr Khelil's replacement, Youcef Yousfi, is competent and well respected, but having been Sonatrach's chief executive and Algeria's oil minister periodically during the 1980s and 1990s does not promise fresh vision. Although the next bidding round is moving ahead faster than industry had expected, the terms have not changed fundamentally.
Having had 50 years since independence to build up its own expertise, Algeria is now demanding technology transfer as a condition of awarding licences. Ironically, Sonatrach is technically capable and has skills in LNG and difficult "tight gas" that are rare among national oil companies. But despite its insights into North Africa's complicated geology, modest projects in Libya, Tunisia, Egypt and Mauritania form an unimpressive international portfolio beside peers such as Norway's Statoil or Brazil's Petrobras.
Beyond this, Algeria badly needs to move its economy away from hydrocarbons, especially since its oil and gas resources are relatively modest compared with its Arab counterparts in the Gulf. Sonatrach, Africa's largest company, still delivers 97 per cent of export earnings. The danger remains of a renewed insurgency attracting recruits from a bored and frustrated younger generation, for whom unemployment is rife.
But recently, the government announced restrictions on foreign investments, decisions on which the former prime minister Ahmed Benbitour, now opposed to Mr Bouteflika, poured scorn. "It's like giving aspirin to someone who has cancer," he said. "You want to protect the economy? You do not do that by forbidding imports, it's by producing." As long as oil and gas earnings offer an easy alternative to reform, and the political scene remains contested between Mr Bouteflika and his prospective successors, Algerians will needto keep pushing their economy's weight uphill.
Robin Mills is an energy economist based in Dubai and the author of The Myth of the Oil Crisis