The class of 2017 is preparing to graduate and will soon be deciding, if they haven't already, where to put down roots.

A new study from Trulia shows 31% of recent college grads relocated in the past year, compared with 11% of adults overall.

The struggle, according to the report, is to find an area that is affordable, but also has a booming job market.

This interactive chart shows where affordability meets jobs:

In the report, Trulia defines college graduates as those that are 22 to 27 years old, and have a bachelor’s degree only.

Trulia researched the most common jobs for recent college grads, then researched where those jobs are most available.

When it comes to finding good jobs, these are the top five metros to find grad-friendly jobs, and the percent of postings in occupations with a high share of recent graduates:

5. Bridgeport-Stamford-Norwalk, Connecticut – 23.3%

4. Boston-Cambridge-Newton Massachusetts-New Hampshire – 23.3%

3. Seattle-Tacoma-Bellevue, Washington – 23.7%

2. San Francisco-Oakland-Hayward, California – 26.8%

1. San Jose-Sunnyvale-Santa Clara, California – 31.6%

However, while these have a plentiful supply of employment opportunities, that doesn't mean college grads can afford to live there. Here are the metros where college grads bring in the most income, along with the median monthly income they bring in:

5. New York-Newark-Jersey City, New York-New Jersey-Pennsylvania – $2,993

4. Houston-The Woodlands-Sugar Land, Texas – $3,188

3. San Francisco-Oakland-Hayward, California – $3,250

2. San Jose-Sunnyvale-Santa Clara, California – $3,333

1. Washington-Arlington-Alexandria, D.C.-Virginia-Maryland-West Virginia – $3,337

But even the best paychecks in some metros aren’t enough, or are barely enough, for college grads to live on. So if affordability is at the top of the list, these are the most affordable metros, and the percentage of affordable listings for college grads:

5. Toledo, Ohio – 37%

4. Akron, Ohio – 38.6%

3. Detroit-Warren-Dearborn, Michigan – 39.5%

2. Youngstown-Warren-Boardman, Ohio-Pennsylvania – 40%

1. Dayton, Ohio – 42.8%

Combining affordable living conditions with the jobs that are available, Trulia's study found that these six metros, in no particular order, hit the sweet spot. 

Seattle, Washington

In this city, 23.7% of jobs listings are for new college grads.

Dayton, Ohio

This city ranks as No. 1 for affordability as 42.8% of rentals are affordable for grads.

Detroit, Michigan

Here, college grads will have no problem finding a place to live as it ranks No. 3 in rental affordability.

Pittsburgh, Pennsylvania

This city holds a good balance as it ranks No. 17 for affordability and No. 37 for jobs available.

Baltimore, Maryland

In this market college grads will find a strong job market and good pay.

Hartford, Connecticut

The city made the list of top 10 metros with the best median income for grads at $2,890.