import matplotlib.pylab as plt
import core
g = core.BayesNet()
g.add_nodes_from(['Earthquake', 'Burglar', 'Alarm', 'Radio', 'Phone'])
g.add_edges_from([('Earthquake', 'Radio'), ('Earthquake', 'Alarm'), (
    'Burglar', 'Alarm'), ('Alarm', 'Phone')])
g.get_reachable('Radio', plot=True)
plt.show()
g.get_reachable('Radio', ['Phone'], plot=True)
plt.show()
g.get_reachable('Radio', ['Phone', 'Earthquake'], plot=True)
plt.show()

309fd3d840e756e8640e6fdf1988daf3835eb5f4
<mask token>

<mask token>
g.add_nodes_from(['Earthquake', 'Burglar', 'Alarm', 'Radio', 'Phone'])
g.add_edges_from([('Earthquake', 'Radio'), ('Earthquake', 'Alarm'), (
    'Burglar', 'Alarm'), ('Alarm', 'Phone')])
g.get_reachable('Radio', plot=True)
plt.show()
g.get_reachable('Radio', ['Phone'], plot=True)
plt.show()
g.get_reachable('Radio', ['Phone', 'Earthquake'], plot=True)
plt.show()

<mask token>
g = core.BayesNet()
g.add_nodes_from(['Earthquake', 'Burglar', 'Alarm', 'Radio', 'Phone'])
g.add_edges_from([('Earthquake', 'Radio'), ('Earthquake', 'Alarm'), (
    'Burglar', 'Alarm'), ('Alarm', 'Phone')])
g.get_reachable('Radio', plot=True)
plt.show()
g.get_reachable('Radio', ['Phone'], plot=True)
plt.show()
g.get_reachable('Radio', ['Phone', 'Earthquake'], plot=True)
plt.show()

import matplotlib.pylab as plt
import core
g = core.BayesNet()
g.add_nodes_from(['Earthquake', 'Burglar', 'Alarm', 'Radio', 'Phone'])
g.add_edges_from([('Earthquake', 'Radio'), ('Earthquake', 'Alarm'), (
    'Burglar', 'Alarm'), ('Alarm', 'Phone')])
g.get_reachable('Radio', plot=True)
plt.show()
g.get_reachable('Radio', ['Phone'], plot=True)
plt.show()
g.get_reachable('Radio', ['Phone', 'Earthquake'], plot=True)
plt.show()
