For anyone who has any question about justification, here's a simple rule of thumb to follow in any situation with regards to drawing.
There are 3 preconditions that must be met before use of deadly force is authorized legally. These are taught in the USAF Security Police Academy, though they are military rules/laws, they can translate well in civilian life.
If 2 of the preconditions are present then drawing is an option, but actually shooting is not.
The preconditions are
1: Opportunity; The person is within range of causing bodily harm to an individual.
2: Intent; The person shows obvious intent to harm some one.
3: Capability; The person has the ability to actually cause bodily harm.
Example 1: An attacker has a knife and is threatening to stab a person who is across the room.
In this example the attacker has capability and intent, but no opportunity since they are not within striking distance.
(In this scenario the attacker is not an expert knife thrower or ninja)
Here you are able to draw, but can not use deadly force since only 2 preconditions are met.
Now, if the attacker turned and charged at the victim with the knife then the 3rd precondition would be met, but as long as they're not within striking distance of the victim, it is not.
Example 2: An attacker has a gun and is pointing it at their intended target and is getting ready to pull the trigger.
In this example deadly force is authorized, but as in any case discretion must be used, just because they have a gun doesn't mean they intend to shoot.
Here the 3 preconditions are met, the person has the opportunity since the victim is within striking distance of the weapon they're using, they have capability, and intent is there by them pointing the weapon at the victim.
Now, how this applies to a mugging is quite easy, if a person threatens you bodily harm and has a weapon then the first 2 preconditions are met, you can draw down.
If the attacker turns and runs then you have no reason to shoot since there are no more preconditions present, if they make a move at you with their weapon, you have all 3 preconditions for use of deadly force.
Always keep in mind that there is a ladder of force, you never want to climb a rung higher than the person who is threatening you, always stay at the same level based on the situation.