Narrative:

On departure from mtn; I was involved in an near midair collision as well as a possible restricted airspace violation. I was talking to potomac departure on 124.55 on VFR flight following. They immediately notified [me] about an inbound aircraft that was 12 o'clock same altitude. They told me that I could start a climb - and if need be; in the class B airspace above my present position. As I started to climb; they notified me that the inbound aircraft began a climb. The inbound aircraft was a collision hazard at 12 o'clock; yet slightly trending left to right. I felt that a descent underneath them would be unsafe; as this aircraft seemed to be leveling off and possibly descending at that point.I made an immediate left turn to avoid the inbound airplane. I am extremely aware of the lateral and vertical boundaries of R-4001A. As I turned left the aircraft passed to my right; same altitude. Potomac instructed me that I was headed towards the restricted airspace- possibly in it. I was already in a right turn to head away from that area as they told me this.this aircraft is not equipped with a traffic reporting map.

Google
 

Original NASA ASRS Text

Title: C172 instructor pilot reported entering restricted airspace during a maneuver to avoid another aircraft.

Narrative: On departure from MTN; I was involved in an NMAC as well as a possible restricted airspace violation. I was talking to Potomac Departure on 124.55 on VFR flight following. They immediately notified [me] about an inbound aircraft that was 12 o'clock same altitude. They told me that I could start a climb - and if need be; in the class B airspace above my present position. As I started to climb; they notified me that the inbound aircraft began a climb. The inbound aircraft was a collision hazard at 12 o'clock; yet slightly trending left to right. I felt that a descent underneath them would be unsafe; as this aircraft seemed to be leveling off and possibly descending at that point.I made an immediate left turn to avoid the inbound airplane. I am extremely aware of the lateral and vertical boundaries of R-4001A. As I turned left the aircraft passed to my right; same altitude. Potomac instructed me that I was headed towards the restricted airspace- possibly in it. I was already in a right turn to head away from that area as they told me this.This aircraft is not equipped with a traffic reporting map.

Data retrieved from NASA's ASRS site and automatically converted to unabbreviated mixed upper/lowercase text. This report is for informational purposes with no guarantee of accuracy. See NASA's ASRS site for official report.