William S. Nelson went to college, served in the Air Force and made his living as an engineer. Now, at age 68, he says he wants and needs little: just an ordinary, affordable apartment near the District, occasional part-time jobs, and his friends.

But in the last two months, since he had to leave his Alexandria apartment because his rent was raised from $400 to $725 a month, he has not been able to find a suitable place that his military pension and savings can bear.

Nelson is living temporarily in a basement apartment near the Lorton Reformatory, a mile from the Prince William County line -- conditions that illustrate dramatically how the increasing cost of housing in the Washington area is uprooting many elderly people on fixed incomes and many working people on low incomes.

The flight of poor people from Alexandria reflects a trend seen throughout the close-in Washington suburbs, local officials say, and it threatens the region's economy because it probably will mean more unfilled low-paying jobs and more homeless people.

In 1974, a regional study showed that 81 percent of Alexandria's housing units were affordable to people with low or moderate incomes. In 1985, city figures show that about 16 percent are affordable.

In 1974, the average Alexandria household earned $14,100; in 1985, it earned $38,722, according to census and city figures. Even after adjustment for inflation, Alexandrians today are 62 percent wealthier than residents a decade ago.

The latest Alexandria housing survey estimates that about 5,100 housing units will be renovated or demolished before 1988. City officials predict that thousands of the city's poorest people will be forced out of their homes and likely out of the city.

"It's a tremendous problem," said Alexandria Mayor James P. Moran Jr. "Those people who help maintain this country's healthy economy are being displaced . . . . Our companies will have to go to West Virginia and rural Virginia to find minimum-wage workers."

Barry Zigas, director of the Washington-based National Low Income Housing Coalition, said that what is happening in Alexandria is occurring in big cities across the country. "In city after city, we're seeing displacement in historic proportions," he said. "Millions are affected."

Most officials agree that several factors are contributing to the displacement: cutbacks in federal funding, the desire of young professionals and wealthy people to live in or move back to the city, spiraling housing costs that have outpaced wage increases, and the deteriorating conditions of the huge amount of low-income housing stock built in the 1940s.

At the least, Washington area officials say, the exodus means more "help wanted" signs outside suburban restaurants.

Already Fairfax County businesses, fast food restaurants and builders have had considerable problems filling low-paying positions, and when Fairfax County Board Chairman John F. Herrity announced the glut of unfilled jobs, other suburban officials said they, too, were beginning to encounter the problem.

Mark Looney, director of the Alexandria Landlord-Tenant Board, said that because there are not enough higher-paying positions for people scrambling to pay higher rents, there likely will be a steady stream of people leaving the area. "There are not enough jobs to enable people to earn enough for expensive housing . . . . If every clerical worker and restaurant worker earned $30,000, maybe they could."

Many of those leaving go to the "nearest low-income area," said Juan Montes, director of the national Anti-Displacement Project, which was recently formed in Washington. "Around here they go to the outlying areas, like Manassas."

But surging housing costs are sending some to the streets, said Montes.

Emergency shelters in the District and its suburbs are housing an increasing number of people, especially families, local officials say, and while the reasons are numerous, many agree the short supply of affordable housing is one cause.

In Montgomery County alone, officials expect 700 more people to seek shelter in their affluent county this winter, bringing the total to 1,700 in nine shelters.

In Fairfax County, where officials have consciously restricted the number of shelters, 125 people stayed in emergency shelter last year. But this year, under increased pressure to absorb the homeless population, officials decided to open a new shelter and house some of the homeless in motels. By January, said John Callahan, project coordinator of Fairfax shelters, the county will be housing twice as many people as last year.

Acute low-income housing shortages and intensified problems of homelessness are being felt not only in the Washington area, national housing officials say, but also in cities across the country.

"If you used just the measure of those being sheltered nightly, which is a poor measure of how bad the affordable housing problem is, you see that in New York City alone 23,000 adults and children are being sheltered on an emergency basis," said Barbara Bower, executive director of the Association for Neighborhood and Housing Development, the parent group for 40 nonprofit community housing groups in New York City.

In addition to those spending nights in temporary shelter, Bower said there are untold numbers unaccounted for: "One of the tragedies is that nobody is tracking where these people go. We know anecdotally. We know there are people living in cars and boxes . . . but no one is tracking it, much less trying to stop it."

After a developer bought the Abingdon Apartments, a rundown complex built in Alexandria around World War II, then renovated them and raised the $300-$400 rents to $595 a month for a one-bedroom apartment and $725 for two bedrooms, all of the 120 tenants moved. No one is required to keep a list of where they went.

In Alexandria the average one-bedroom apartment costs $530 a month, according to the latest city estimates, and rents have jumped about 30 percent in two years. Most salaries, on the other hand, have increased only to meet single-digit inflation, officials say.

The inequity in wage and housing increases is seen on the national level in analyses of the 1970 and 1980 censuses by Zigas' group. In 1970, 8.4 million American households earned less than $5,000 a year, but the supply of affordable housing, that costing 30 percent of total income, was plentiful, with 14.9 million housing units renting monthly for $135 or less.

Despite inflation, in 1980 there were still 6.3 million households earning less than $5,000 a year, but only 2.7 million apartments renting monthly for $135 or less.

The result, officials say, is that many people cannot live close to their work place. Alicia Cruz, a 38-year-old single mother of two who makes $15,800 a year as a library technical assistant for the Internal Revenue Service, fits the profile.

Two months ago, Cruz moved out of the Abingdon Apartments and more than an hour farther away from her job in the District. After 11 months of searching, the closest affordable apartment she could find was in a government-subsidized complex in southern Fairfax County, far from the Metro subway system.

Like Nelson, who is now in a Lorton apartment, Cruz had lived in the Abingdon for years. But when the new owner began planning gymnasiums with ballet barres and lounges with wet bars, she moved. It was not that she disliked the new facilities, Cruz said, "But how could I afford to pay twice as much rent?"

Still, Cruz says she was luckier than most. "I was one of the very few who came out okay after the Abingdon closed," she said, "and still, it's hard. It takes me an hour and 50 minutes to get to work . . . but the others had to move in with friends, family or into dangerous or not-nice areas of other places."

There are as many as 134,000 people in the Washington area who are eligible for publicly assisted housing but who, unlike Cruz, have not found space, according to a recently released report by the Metropolitan Washington Council of Governments.

The Reagan administration and federal cutbacks, far more than developers of luxury apartments, are to blame, most housing and elected officials say.

Since President Reagan took office in 1981, federal housing assistance funds have been slashed 60 percent. These cuts are felt locally, for example, in the Alexandria Redevelopment and Housing Authority fund for maintaining public housing. That budget in 1984 was $650,000; this year it is $25,000.

This month's passage of the Gramm-Rudman-Hollings federal budget amendment, which mandates deep cuts in domestic programs to try to balance the budget, is feared by area officials as a deadly blow to already scarce funds.

"This represents the abandonment of 50 years of commitment to help every American have a decent home," said Zigas. Instead of helping the increasing number of people who spend more than one-third of their income on rent, he said, the government has chosen to support homeowner tax deductions that largely benefit the middle and upper class.

Beverly Steele, Alexandria's acting housing director, suggested several tactics for curbing displacement, including the convening of a roundtable of city business persons, Realtors and developers to plan strategy. She said that in the absence of tax-exempt bonds for developers to set aside some renovated apartments for poor people, the city could offer zoning concessions allowing them to construct buildings with more units.

Other officials say that state and local governments will have to pinch their budgets in other areas and begin to offer housing assistance, as Maryland Gov. Harry Hughes has proposed.

Hughes announced two weeks ago that because of "deplorable" housing conditions, he will try to pump a substantial amount of money into rent subsidies for low-income residents.

But innovative ideas and local money, many agree, will not solve the problem. If the problem is to be dealt with, officials say, the federal government must rearrange its priorities and reconsider its housing cuts.

"There is no way localities can deal with this problem," said Alexandria Mayor Moran. "It's beyond even the region. It's overwhelming."

What has happened to a city that in a 1974 regional planning report was heralded as "leading the way in the suburban metropolitan Washington area in providing for low and moderate-income families" will be debated in national and local housing meetings throughout 1986.

But for Bill Nelson, who sometimes returns to the Abingdon because of the fond memories it brings, part of the new year, he said, may be spent looking for permanent housing in the Shenandoah Valley.