This was on Hard difficulty, but I don't see any reason it couldn't be done on Very Hard or Survival.
After leaving the vault I headed north, then west, then southwest, then south. Avoided the mole rat, grabbed the loot at the RR observation point, avoided the blood bug at the creek and headed southwest. Avoided the raiders at the powerline, though they did detect me and I ran, sprinting across the creek and along the power line east until I got in sight of the Ranger Cabin and Abernathy Farm.
Turned right and weaved my way along between locations (avoiding getting close enough to "discover" them) avoided bloatflies, avoided ghouls at Gorski Cabin, followed a radstag to south, then cut sharply east a bit to get on the road on west side of Lexington.
Avoided the rad roaches at the collapsed house to west of Corvega, stayed on the road south, and when I got to the Charles, turned right and crossed the Charles using the railroad bridge near Beantown. Avoided getting too close to Beantown then hugged the southern bank of the Charles all the way to where it got to the next bridge. From there it was a breeze to get to Diamond City.
Once I met Piper I immediately recruited her and started doing stuff she would like.
Gave Sheffield a Nuka-Cola. pvssyd with Ms. Edna. Helped Sheng with his water purifier. pvssyd with Vadim, helped Travis in the barfight and then played matchmaker. By the time of the kidnapping of Vadim quest in "Confidence Man" popped I had a reasonable set of kit if I recall, but I couldn't think of any more quests "in" D.C. that would necessarily involve the kind of behaviors Piper likes. At one point I did hack the mayor's safe, but because that is red she actually DISLIKED that!
So we headed to BackStreet Apparel, which is the real key to doing this . . . as long as you have enough lockpicks and the capacity to Clear BackStreet, you are golden.
Cleared Backstreet, and started hacking. By this time I was probably level 3 or 4 so I had Hacking 1 and Lockpicking 1, something like that. I'm pretty good at both those mini-games, but both the computer and safe are "Advanced" so I think you need at least level 1 in both those perks. Actually not 100% sure on the lockpicking . . .
It was then I realized, I only had about 3 lockpicks! I cracked it as many times as I could but eventually broke all three of them.
So I had to go back to D.C. and buy more lockpicks, but no one had any (or I overlooked them). So I resolved to go for a tour around the immediate outskirts of D.C. (something I had never done and it was fun, quite a few easter eggs and things you can climb up into that most users have probably missed so far). This tour of the immediate outside of the city led me to inadvertently visit the police station and public library which bumped my total locations up from only four to six visited. I'd say the minimum (without using console) would be:
1. Vault 111
2. D.C.
3. D.C. Market
4. Backstreet
I suppose you could even get away with not going to D.C. market but to do that you'd either have to cheat yourself some bobby pins, or know where you can go find them without visiting a location.
I still hadn't found that many bobby pins so I decided to just go with the Beantown quest, so that put me up to seven actually visited locations:
1. Vault 111
2. D.C.
3. D.C. Market
4. Backstreet
5. Police Precinct 8
6. Boston Public Library
7. Beantown
As far as the technique for gaining affinity: First clear all of Backstreet (you apparently cannot wait there till it is clear). The room with the terminal controlled safe is behind the cash registers (to right as you head toward stairs). There is a sofa and chair in the same area with the safe/terminal (also a workbench there) and I always told Piper to wait sitting on the sofa so she didn't run off and not see me being amazing with my bobby pins! Pick the safe, leave at least one item in it = KACHING! Piper liked that. Hack the terminal if you haven't already (only have to hack it once thank Atom) and lock up the safe again. Make a save, sit down on the sofa and wait 3 hours (supposedly this is how long it takes for the cool down, though at one point I did see something that would dispute that . . . I didn't have the resolve to test it though, thus the 172 hours waited): repeat.
I think at least one period of waiting was in association with the Confidence Man quests. 172/3 = 57.333, so I'd say I had to repeat the safe cracking anywhere from 50 to 55 times and that is in addition to the other stuff I did. The couple times that I looked in the console the lockpicking seemed to be racking up 10 points of affinity, so that makes reasonable sense: roughly 500 of affinity from cracking that safe repeatedly and another 500 from nice comments in dialogues, quests and the like.