I have the same problem. The repair guy said that it could be the problem of logic board, so I changed a new one, but not the graphic card. When I took it home, it went well for couple of days. But then, the same problem reappeared. And I changed different electric outlet and different cord, not working. I am wondering will change the graphic card work? It's so frustrating.
+
+
=== Update (02/27/2017) ===
+
+
I think I got the problem solved.
+
+
Originally, I got the same restarting problem. So I sent it for repair, and the shop told me that it was the logic board problem. I thought since I have to change the logic board, I should upgrade it at the same time. So I changed the logic board, CPU, and SSD hard drive, but not graphic card. When it came back, it worked fine for a couple of days, but the same problem came back. Then I sent it back for test, and the shop told me it might be the hard drive problem, so they changed it and sent it back. Unfortunately, the same problem came back in a couple of days. I was desperate, and ready to buy a new iMac. Luckily, I found this post:
In the end, I asked the shop changing the PSU unit. It's been a week, I never shut down the computer, and it never got one instant of that restarting problem.
I have the same problem. The repair guy said that it could be the problem of logic board, so I changed a new one, but not the graphic card. When I took it home, it went well for couple of days. But then, the same problem reappeared. And I changed different electric outlet and different cord, not working. I am wondering will change the graphic card work? It's so frustrating.