{
 "cells": [
  {
   "cell_type": "code",
   "id": "initial_id",
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2026-05-23T20:56:43.488066Z",
     "start_time": "2026-05-23T20:56:41.855404Z"
    }
   },
   "source": [
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "df = pd.read_csv(\"results.csv\")\n",
    "\n",
    "# график времени\n",
    "plt.figure(figsize=(10, 5))\n",
    "for algo in df[\"algorithm\"].unique():\n",
    "    subset = df[df[\"algorithm\"] == algo]\n",
    "    plt.plot(subset[\"maze\"], subset[\"time_ms\"], marker=\"o\", label=algo)\n",
    "\n",
    "plt.title(\"Время работы алгоритмов\")\n",
    "plt.ylabel(\"ms\")\n",
    "plt.legend()\n",
    "plt.grid(True)\n",
    "plt.show()\n",
    "\n",
    "# график посещённых клеток\n",
    "plt.figure(figsize=(10, 5))\n",
    "for algo in df[\"algorithm\"].unique():\n",
    "    subset = df[df[\"algorithm\"] == algo]\n",
    "    plt.plot(subset[\"maze\"], subset[\"visited\"], marker=\"o\", label=algo)\n",
    "\n",
    "plt.title(\"Количество посещённых клеток\")\n",
    "plt.ylabel(\"cells\")\n",
    "plt.legend()\n",
    "plt.grid(True)\n",
    "plt.show()"
   ],
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Figure size 1000x500 with 1 Axes>"
      ],
      "image/png": "[encoded data, 73796 characters]"
     },
     "metadata": {},
     "output_type": "display_data",
     "jetTransient": {
      "display_id": null
     }
    },
    {
     "data": {
      "text/plain": [
       "<Figure size 1000x500 with 1 Axes>"
      ],
      "image/png": "[encoded data, 52224 characters]"
     },
     "metadata": {},
     "output_type": "display_data",
     "jetTransient": {
      "display_id": null
     }
    }
   ],
   "execution_count": 1
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
