Repository: hochbaumGroup/pseudoflow-parametric-cut (language: python)

Issue:
Updated hpf.py to support igraph
The Python interface now works with both networkx and igraph graph objects.


Discussion / hints:
Have you looked at using Igraph's functionality to convert to NetworkX, e.g. `g.to_networkx()`. That seems easier than converting it within `HPF`.

Fix patch:
diff --git a/Pipfile b/Pipfile
index 4072f20..284ab03 100644
--- a/Pipfile
+++ b/Pipfile
@@ -5,9 +5,9 @@ verify_ssl = true
 
 [dev-packages]
 pytest = "*"
-pytest-runner = "*"
 networkx = "*"
 twine = "*"
+igraph = "*"
 
 [packages]
 pseudoflow = {editable = true,path = "."}
diff --git a/Pipfile.lock b/Pipfile.lock
index f9bb0cf..2341f3e 100644
--- a/Pipfile.lock
+++ b/Pipfile.lock
@@ -1,7 +1,7 @@
 {
     "_meta": {
         "hash": {
-            "sha256": "8f5eab481bc503bff3cdd216290ea7627d8fe8fc4ecffd1f26a282aa026e0b35"
+            "sha256": "9d3f988acee7f1f8f97d5046201341b9709eb4e40086ce7c65fbc044ce9f288f"
         },
         "pipfile-spec": 6,
         "requires": {
@@ -20,10 +20,6 @@
             "editable": true,
             "path": "."
         },
-        "sanitized-package": {
-            "editable": true,
-            "path": "."
-        },
         "six": {
             "hashes": [
                 "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926",
@@ -36,11 +32,11 @@
     "develop": {
         "attrs": {
             "hashes": [
-                "sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6",
-                "sha256:86efa402f67bf2df34f51a335487cf46b1ec130d02b8d39fd248abfd30da551c"
+                "sha256:29e95c7f6778868dbd49170f98f8818f78f3dc5e0e37c0b1f474e3561b240836",
+                "sha256:c9227bfc2f01993c03f68db37d1d15c9690188323c067c641f1a35ca58185f99"
             ],
-            "markers": "python_version >= '3.5'",
-            "version": "==22.1.0"
+            "markers": "python_version >= '3.6'",
+            "version": "==22.2.0"
         },
         "bleach": {
             "hashes": [
@@ -55,125 +51,31 @@
                 "sha256:35824b4c3a97115964b408844d64aa14db1cc518f6562e8d7261699d1350a9e3",
                 "sha256:4ad3232f5e926d6718ec31cfc1fcadfde020920e278684144551c91769c7bc18"
             ],
-            "index": "pypi",
+            "markers": "python_version >= '3.6'",
             "version": "==2022.12.7"
         },
-        "cffi": {
-            "hashes": [
-                "sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5",
-                "sha256:03425bdae262c76aad70202debd780501fabeaca237cdfddc008987c0e0f59ef",
-                "sha256:04ed324bda3cda42b9b695d51bb7d54b680b9719cfab04227cdd1e04e5de3104",
-                "sha256:0e2642fe3142e4cc4af0799748233ad6da94c62a8bec3a6648bf8ee68b1c7426",
-                "sha256:173379135477dc8cac4bc58f45db08ab45d228b3363adb7af79436135d028405",
-                "sha256:198caafb44239b60e252492445da556afafc7d1e3ab7a1fb3f0584ef6d742375",
-                "sha256:1e74c6b51a9ed6589199c787bf5f9875612ca4a8a0785fb2d4a84429badaf22a",
-                "sha256:2012c72d854c2d03e45d06ae57f40d78e5770d252f195b93f581acf3ba44496e",
-                "sha256:21157295583fe8943475029ed5abdcf71eb3911894724e360acff1d61c1d54bc",
-                "sha256:2470043b93ff09bf8fb1d46d1cb756ce6132c54826661a32d4e4d132e1977adf",
-                "sha256:285d29981935eb726a4399badae8f0ffdff4f5050eaa6d0cfc3f64b857b77185",
-                "sha256:30d78fbc8ebf9c92c9b7823ee18eb92f2e6ef79b45ac84db507f52fbe3ec4497",
-                "sha256:320dab6e7cb2eacdf0e658569d2575c4dad258c0fcc794f46215e1e39f90f2c3",
-                "sha256:33ab79603146aace82c2427da5ca6e58f2b3f2fb5da893ceac0c42218a40be35",
-                "sha256:3548db281cd7d2561c9ad9984681c95f7b0e38881201e157833a2342c30d5e8c",
-                "sha256:3799aecf2e17cf585d977b780ce79ff0dc9b78d799fc694221ce814c2c19db83",
-                "sha256:39d39875251ca8f612b6f33e6b1195af86d1b3e60086068be9cc053aa4376e21",
-                "sha256:3b926aa83d1edb5aa5b427b4053dc420ec295a08e40911296b9eb1b6170f6cca",
-                "sha256:3bcde07039e586f91b45c88f8583ea7cf7a0770df3a1649627bf598332cb6984",
-                "sha256:3d08afd128ddaa624a48cf2b859afef385b720bb4b43df214f85616922e6a5ac",
-                "sha256:3eb6971dcff08619f8d91607cfc726518b6fa2a9eba42856be181c6d0d9515fd",
-                "sha256:40f4774f5a9d4f5e344f31a32b5096977b5d48560c5592e2f3d2c4374bd543ee",
-                "sha256:4289fc34b2f5316fbb762d75362931e351941fa95fa18789191b33fc4cf9504a",
-                "sha256:470c103ae716238bbe698d67ad020e1db9d9dba34fa5a899b5e21577e6d52ed2",
-                "sha256:4f2c9f67e9821cad2e5f480bc8d83b8742896f1242dba247911072d4fa94c192",
-                "sha256:50a74364d85fd319352182ef59c5c790484a336f6db772c1a9231f1c3ed0cbd7",
-                "sha256:54a2db7b78338edd780e7ef7f9f6c442500fb0d41a5a4ea24fff1c929d5af585",
-                "sha256:5635bd9cb9731e6d4a1132a498dd34f764034a8ce60cef4f5319c0541159392f",
-                "sha256:59c0b02d0a6c384d453fece7566d1c7e6b7bae4fc5874ef2ef46d56776d61c9e",
-                "sha256:5d598b938678ebf3c67377cdd45e09d431369c3b1a5b331058c338e201f12b27",
-                "sha256:5df2768244d19ab7f60546d0c7c63ce1581f7af8b5de3eb3004b9b6fc8a9f84b",
-                "sha256:5ef34d190326c3b1f822a5b7a45f6c4535e2f47ed06fec77d3d799c450b2651e",
-                "sha256:6975a3fac6bc83c4a65c9f9fcab9e47019a11d3d2cf7f3c0d03431bf145a941e",
-                "sha256:6c9a799e985904922a4d207a94eae35c78ebae90e128f0c4e521ce339396be9d",
-                "sha256:70df4e3b545a17496c9b3f41f5115e69a4f2e77e94e1d2a8e1070bc0c38c8a3c",
-                "sha256:7473e861101c9e72452f9bf8acb984947aa1661a7704553a9f6e4baa5ba64415",
-                "sha256:8102eaf27e1e448db915d08afa8b41d6c7ca7a04b7d73af6514df10a3e74bd82",
-                "sha256:87c450779d0914f2861b8526e035c5e6da0a3199d8f1add1a665e1cbc6fc6d02",
-                "sha256:8b7ee99e510d7b66cdb6c593f21c043c248537a32e0bedf02e01e9553a172314",
-                "sha256:91fc98adde3d7881af9b59ed0294046f3806221863722ba7d8d120c575314325",
-                "sha256:94411f22c3985acaec6f83c6df553f2dbe17b698cc7f8ae751ff2237d96b9e3c",
-                "sha256:98d85c6a2bef81588d9227dde12db8a7f47f639f4a17c9ae08e773aa9c697bf3",
-                "sha256:9ad5db27f9cabae298d151c85cf2bad1d359a1b9c686a275df03385758e2f914",
-                "sha256:a0b71b1b8fbf2b96e41c4d990244165e2c9be83d54962a9a1d118fd8657d2045",
-                "sha256:a0f100c8912c114ff53e1202d0078b425bee3649ae34d7b070e9697f93c5d52d",
-                "sha256:a591fe9e525846e4d154205572a029f653ada1a78b93697f3b5a8f1f2bc055b9",
-                "sha256:a5c84c68147988265e60416b57fc83425a78058853509c1b0629c180094904a5",
-                "sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2",
-                "sha256:a8c4917bd7ad33e8eb21e9a5bbba979b49d9a97acb3a803092cbc1133e20343c",
-                "sha256:b3bbeb01c2b273cca1e1e0c5df57f12dce9a4dd331b4fa1635b8bec26350bde3",
-                "sha256:cba9d6b9a7d64d4bd46167096fc9d2f835e25d7e4c121fb2ddfc6528fb0413b2",
-                "sha256:cc4d65aeeaa04136a12677d3dd0b1c0c94dc43abac5860ab33cceb42b801c1e8",
-                "sha256:ce4bcc037df4fc5e3d184794f27bdaab018943698f4ca31630bc7f84a7b69c6d",
-                "sha256:cec7d9412a9102bdc577382c3929b337320c4c4c4849f2c5cdd14d7368c5562d",
-                "sha256:d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9",
-                "sha256:d61f4695e6c866a23a21acab0509af1cdfd2c013cf256bbf5b6b5e2695827162",
-                "sha256:db0fbb9c62743ce59a9ff687eb5f4afbe77e5e8403d6697f7446e5f609976f76",
-                "sha256:dd86c085fae2efd48ac91dd7ccffcfc0571387fe1193d33b6394db7ef31fe2a4",
-                "sha256:e00b098126fd45523dd056d2efba6c5a63b71ffe9f2bbe1a4fe1716e1d0c331e",
-                "sha256:e229a521186c75c8ad9490854fd8bbdd9a0c9aa3a524326b55be83b54d4e0ad9",
-                "sha256:e263d77ee3dd201c3a142934a086a4450861778baaeeb45db4591ef65550b0a6",
-                "sha256:ed9cb427ba5504c1dc15ede7d516b84757c3e3d7868ccc85121d9310d27eed0b",
-                "sha256:fa6693661a4c91757f4412306191b6dc88c1703f780c8234035eac011922bc01",
-                "sha256:fcd131dd944808b5bdb38e6f5b53013c5aa4f334c5cad0c72742f6eba4b73db0"
-            ],
-            "version": "==1.15.1"
-        },
         "charset-normalizer": {
             "hashes": [
                 "sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845",
                 "sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f"
             ],
-            "markers": "python_version >= '3.6'",
+            "markers": "python_full_version >= '3.6.0'",
             "version": "==2.1.1"
         },
-        "cryptography": {
-            "hashes": [
-                "sha256:0e70da4bdff7601b0ef48e6348339e490ebfb0cbe638e083c9c41fb49f00c8bd",
-                "sha256:10652dd7282de17990b88679cb82f832752c4e8237f0c714be518044269415db",
-                "sha256:175c1a818b87c9ac80bb7377f5520b7f31b3ef2a0004e2420319beadedb67290",
-                "sha256:1d7e632804a248103b60b16fb145e8df0bc60eed790ece0d12efe8cd3f3e7744",
-                "sha256:1f13ddda26a04c06eb57119caf27a524ccae20533729f4b1e4a69b54e07035eb",
-                "sha256:2ec2a8714dd005949d4019195d72abed84198d877112abb5a27740e217e0ea8d",
-                "sha256:2fa36a7b2cc0998a3a4d5af26ccb6273f3df133d61da2ba13b3286261e7efb70",
-                "sha256:2fb481682873035600b5502f0015b664abc26466153fab5c6bc92c1ea69d478b",
-                "sha256:3178d46f363d4549b9a76264f41c6948752183b3f587666aff0555ac50fd7876",
-                "sha256:4367da5705922cf7070462e964f66e4ac24162e22ab0a2e9d31f1b270dd78083",
-                "sha256:4eb85075437f0b1fd8cd66c688469a0c4119e0ba855e3fef86691971b887caf6",
-                "sha256:50a1494ed0c3f5b4d07650a68cd6ca62efe8b596ce743a5c94403e6f11bf06c1",
-                "sha256:53049f3379ef05182864d13bb9686657659407148f901f3f1eee57a733fb4b00",
-                "sha256:6391e59ebe7c62d9902c24a4d8bcbc79a68e7c4ab65863536127c8a9cd94043b",
-                "sha256:67461b5ebca2e4c2ab991733f8ab637a7265bb582f07c7c88914b5afb88cb95b",
-                "sha256:78e47e28ddc4ace41dd38c42e6feecfdadf9c3be2af389abbfeef1ff06822285",
-                "sha256:80ca53981ceeb3241998443c4964a387771588c4e4a5d92735a493af868294f9",
-                "sha256:8a4b2bdb68a447fadebfd7d24855758fe2d6fecc7fed0b78d190b1af39a8e3b0",
-                "sha256:8e45653fb97eb2f20b8c96f9cd2b3a0654d742b47d638cf2897afbd97f80fa6d",
-                "sha256:998cd19189d8a747b226d24c0207fdaa1e6658a1d3f2494541cb9dfbf7dcb6d2",
-                "sha256:a10498349d4c8eab7357a8f9aa3463791292845b79597ad1b98a543686fb1ec8",
-                "sha256:b4cad0cea995af760f82820ab4ca54e5471fc782f70a007f31531957f43e9dee",
-                "sha256:bfe6472507986613dc6cc00b3d492b2f7564b02b3b3682d25ca7f40fa3fd321b",
-                "sha256:c9e0d79ee4c56d841bd4ac6e7697c8ff3c8d6da67379057f29e66acffcd1e9a7",
-                "sha256:ca57eb3ddaccd1112c18fc80abe41db443cc2e9dcb1917078e02dfa010a4f353",
-                "sha256:ce127dd0a6a0811c251a6cddd014d292728484e530d80e872ad9806cfb1c5b3c"
+        "colorama": {
+            "hashes": [
+                "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44",
+                "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"
             ],
-            "markers": "python_version >= '3.6'",
-            "version": "==38.0.4"
+            "markers": "sys_platform == 'win32'",
+            "version": "==0.4.6"
         },
-        "decorator": {
+        "commonmark": {
             "hashes": [
-                "sha256:637996211036b6385ef91435e4fae22989472f9d571faba8927ba8253acbc330",
-                "sha256:b8c3f85900b9dc423225913c5aace94729fe1fa9763b38939a95226f02d37186"
+                "sha256:452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60",
+                "sha256:da2f38c92590f83de410ba1a3cbceafbc74fee9def35f9251ba9a971d6d66fd9"
             ],
-            "markers": "python_version >= '3.5'",
-            "version": "==5.1.1"
+            "version": "==0.9.1"
         },
         "docutils": {
             "hashes": [
@@ -183,6 +85,14 @@
             "markers": "python_version >= '3.7'",
             "version": "==0.19"
         },
+        "exceptiongroup": {
+            "hashes": [
+                "sha256:327cbda3da756e2de031a3107b81ab7b3770a602c4d16ca618298c526f4bec1e",
+                "sha256:bcb67d800a4497e1b404c2dd44fca47d3b7a5e5433dbab67f96c1a685cdfdf23"
+            ],
+            "markers": "python_version < '3.11'",
+            "version": "==1.1.0"
+        },
         "idna": {
             "hashes": [
                 "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4",
@@ -191,13 +101,79 @@
             "markers": "python_version >= '3.5'",
             "version": "==3.4"
         },
+        "igraph": {
+            "hashes": [
+                "sha256:09191e7c979da7e8fff53cd199ea6e023e2ae3d8917021fc7f993a0a8f1cffca",
+                "sha256:0dd5e0a5ed235a38bcf406835f295fe7cafa372bbac23059928bc30a2877d99d",
+                "sha256:1004d0e33b7b1c69deb4df2c1730c4d361b494289540fe357d93694f06925b60",
+                "sha256:1523cabf71460c3e02524940fc6642b8782bfa228888057c20398919e3b88681",
+                "sha256:1b97938eeb9bbe5cca40b6fafceb182749e1ba30f4d20cff2f1150303924eff6",
+                "sha256:215c53591b0bccd2082ef0e007e1919f25c040abb03014bdb4f20712173e33c2",
+                "sha256:27376837e4f66ea8829cf350eba217906a8be4f8ae8166ff243cf69ecad73726",
+                "sha256:2810bf2175fe6c16dd3dc7eef420a272baf89d88e0c16fcfe98fa80daf613825",
+                "sha256:2b635762137ec810db0620cc6fa9ada5923cb6307f8dafb3290f59e72eabccb2",
+                "sha256:2db9d4421e27ddc452271c04c1af22d47166f4e88c1f287787229f71900ecf0e",
+                "sha256:32a1de4211e57f63b22d0593df82b9f20998614a50730a56efc36047046da35a",
+                "sha256:33802df1c6d0ae75887da5d784e47c520ab1c3b2c051e3bd22005b4f344042f3",
+                "sha256:345b40aefca1b2bd62cdcbd39b4734a367db1e21e5e69e92f4be0179f54bd1e4",
+                "sha256:38fcc3751015187d9568404d3a29fc71e75757a8e2a74055fabab89d65850a71",
+                "sha256:3b03e910ec44f98780dcf048a30cd1e3494d2b26a00bb6c08e08cf836f26d1ed",
+                "sha256:3f0dce0f9213c350dcdf1647596aedac3bb21c300675d02bae8ea6ec927dd173",
+                "sha256:475a4b239cbc61c60e44ad2c24f6798f5e4ad8901a94a0e1c6d9cc7c36f72fea",
+                "sha256:54c7268d9788006d8249fe281203bdfd50f0f3c0264f41b4769b241395155601",
+                "sha256:5ed75bc7a36fc0a4fb7dfa95c53d7c4c163e2a4a9edf1aa510875fc52d77f5de",
+                "sha256:74fe10adf9a11b7fbbc2c5b26b547c159a2bab0952d9cc8ac12046654cd0ee75",
+                "sha256:7a7ebaa54d4981ea95b85e85704189a9a6e0a0eacba1fe6a619645d49f2d919d",
+                "sha256:7c75e0ec477167aa6adc534edc897785dd22dd6684498b40667b211a9882388e",
+                "sha256:82cf51fdb9a2746c52bc604d908514e79c8f3621fdba319001bc1eb074afe542",
+                "sha256:85e9b0fa8a759e1977935f6a9544d94467042ad31f2580e051a15cfe4acb09f8",
+                "sha256:8df67cf50624b7d1298ee929e6509589103380e22f8608e20e7b041e9751231c",
+                "sha256:8f1b6abcb5f5b19603fde45991413b625039b8d77f4bee109ac24e37fdafc476",
+                "sha256:92db0fa2cb2ae04cedeca28a9725d1c5ca6feed1c68e1ddacb230b93dc398570",
+                "sha256:944dad4e196782f48eda8c233b514aeec47fde32def8f34982fe316c8b64c09b",
+                "sha256:95826915962f938e3e0a37c12f74f7e6e35dbb365ab03f5ab94e2f4d648c84d0",
+                "sha256:9b04725a5c4b44c446dd76847fdf750f9d0e4ebc3ce76341f405f7bd811fc882",
+                "sha256:a2851c0dd32a875cf835c6971c26e5033ab5d6149a30d065bdbbcb89bd53864a",
+                "sha256:a8aef28df3576d2648d1205dfc1545f2052866194ddfc5672d4c98a5b0e5741b",
+                "sha256:aa534c5b1ef79fb9095ea923482d53d614ee157d07aa520449905ead89ff7b6f",
+                "sha256:ab364d4889bee5de79fdd770f5c71fd87d309810f12c22ed170109488cd3ad02",
+                "sha256:c8848956744abe1b740955f800f24a7983449abce5501bb012002a7c44994ab3",
+                "sha256:cbb895b9a339849067d1c1c1dc7221452feebd4d54fc3c06e6592e5673d73bd2",
+                "sha256:d1f9549595f2e0de1a89bf70f27d84c4c09e0b387dc01c30a726d3abba2928cc",
+                "sha256:d81be4136bf3b6ecf3d6e5d766b213672a1f64e8284ba58ed273e8eff9ba1e19",
+                "sha256:de570e6532d9f82a364db04fdc826f0e67f0dd1c85eb6767976ed24832af55d4",
+                "sha256:eb4fce55c06f50226f27e39acc6310580387c1029c6ff4eef0bc30c68603d1e4",
+                "sha256:ed327ed3cf8837678018471f871397285a9e1e95bfba31fb87f7fed11237ea01",
+                "sha256:f271f7f30465eb5d83b24757da37d3a121f9adafe5deb9d40abfc9772f7b15e1",
+                "sha256:f3a663ec5c00db08eb777c7d3d6b9d129283c165d7f3c8ce78386152a8d0b10c",
+                "sha256:fa1e3dd74530602428c971db74ab0755fd388c7760511a45a7e12da7be28719b",
+                "sha256:fa304a541691f648431ce5d25376d044914d4342278fcf359bd0303d0f8376d5"
+            ],
+            "index": "pypi",
+            "version": "==0.10.2"
+        },
         "importlib-metadata": {
             "hashes": [
-                "sha256:d5059f9f1e8e41f80e9c56c2ee58811450c31984dfa625329ffd7c0dad88a73b",
-                "sha256:d84d17e21670ec07990e1044a99efe8d615d860fd176fc29ef5c306068fda313"
+                "sha256:0eafa39ba42bf225fc00e67f701d71f85aead9f878569caf13c3724f704b970f",
+                "sha256:404d48d62bba0b7a77ff9d405efd91501bef2e67ff4ace0bed40a0cf28c3c7cd"
+            ],
+            "markers": "python_version >= '3.7'",
+            "version": "==5.2.0"
+        },
+        "importlib-resources": {
+            "hashes": [
+                "sha256:7d543798b0beca10b6a01ac7cafda9f822c54db9e8376a6bf57e0cbd74d486b6",
+                "sha256:e4a96c8cc0339647ff9a5e0550d9f276fc5a01ffa276012b58ec108cfd7b8484"
+            ],
+            "markers": "python_version < '3.9'",
+            "version": "==5.10.2"
+        },
+        "iniconfig": {
+            "hashes": [
+                "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3",
+                "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32"
             ],
-            "markers": "python_version < '3.12'",
-            "version": "==5.1.0"
+            "version": "==1.1.1"
         },
         "jaraco.classes": {
             "hashes": [
@@ -207,21 +183,13 @@
             "markers": "python_version >= '3.7'",
             "version": "==3.2.3"
         },
-        "jeepney": {
-            "hashes": [
-                "sha256:5efe48d255973902f6badc3ce55e2aa6c5c3b3bc642059ef3a91247bcfcc5806",
-                "sha256:c0a454ad016ca575060802ee4d590dd912e35c122fa04e70306de3d076cce755"
-            ],
-            "markers": "sys_platform == 'linux'",
-            "version": "==0.8.0"
-        },
         "keyring": {
             "hashes": [
-                "sha256:3dd30011d555f1345dec2c262f0153f2f0ca6bca041fb1dc4588349bb4c0ac1e",
-                "sha256:ad192263e2cdd5f12875dedc2da13534359a7e760e77f8d04b50968a821c2361"
+                "sha256:771ed2a91909389ed6148631de678f82ddc73737d85a927f382a8a1b157898cd",
+                "sha256:ba2e15a9b35e21908d0aaf4e0a47acc52d6ae33444df0da2b49d41a46ef6d678"
             ],
             "markers": "python_version >= '3.7'",
-            "version": "==23.11.0"
+            "version": "==23.13.1"
         },
         "more-itertools": {
             "hashes": [
@@ -233,11 +201,11 @@
         },
         "networkx": {
             "hashes": [
-                "sha256:cdfbf698749a5014bf2ed9db4a07a5295df1d3a53bf80bf3cbd61edf9df05fa1",
-                "sha256:f8f4ff0b6f96e4f9b16af6b84622597b5334bf9cae8cf9b2e42e7985d5c95c64"
+                "sha256:230d388117af870fce5647a3c52401fcf753e94720e6ea6b4197a5355648885e",
+                "sha256:e435dfa75b1d7195c7b8378c3859f0445cd88c6b0375c181ed66823a9ceb7524"
             ],
             "index": "pypi",
-            "version": "==2.4"
+            "version": "==2.8.8"
         },
         "packaging": {
             "hashes": [
@@ -257,26 +225,11 @@
         },
         "pluggy": {
             "hashes": [
-                "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0",
-                "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"
-            ],
-            "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
-            "version": "==0.13.1"
-        },
-        "py": {
-            "hashes": [
-                "sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719",
-                "sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378"
-            ],
-            "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'",
-            "version": "==1.11.0"
-        },
-        "pycparser": {
-            "hashes": [
-                "sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9",
-                "sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"
+                "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159",
+                "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3"
             ],
-            "version": "==2.21"
+            "markers": "python_version >= '3.6'",
+            "version": "==1.0.0"
         },
         "pygments": {
             "hashes": [
@@ -288,19 +241,19 @@
         },
         "pytest": {
             "hashes": [
-                "sha256:0e5b30f5cb04e887b91b1ee519fa3d89049595f428c1db76e73bd7f17b09b172",
-                "sha256:84dde37075b8805f3d1f392cc47e38a0e59518fb46a431cfdaf7cf1ce805f970"
+                "sha256:892f933d339f068883b6fd5a459f03d85bfcb355e4981e146d2c7616c21fef71",
+                "sha256:c4014eb40e10f11f355ad4e3c2fb2c6c6d1919c73f3b5a433de4708202cade59"
             ],
             "index": "pypi",
-            "version": "==5.4.1"
+            "version": "==7.2.0"
         },
-        "pytest-runner": {
+        "pywin32-ctypes": {
             "hashes": [
-                "sha256:5534b08b133ef9a5e2c22c7886a8f8508c95bb0b0bdc6cc13214f269c3c70d51",
-                "sha256:96c7e73ead7b93e388c5d614770d2bae6526efd997757d3543fe17b557a0942b"
+                "sha256:24ffc3b341d457d48e8922352130cf2644024a4ff09762a2261fd34c36ee5942",
+                "sha256:9dc2d991b3479cc2df15930958b674a48a227d5361d413827a4cfd0b5876fc98"
             ],
-            "index": "pypi",
-            "version": "==5.2"
+            "markers": "sys_platform == 'win32'",
+            "version": "==0.2.0"
         },
         "readme-renderer": {
             "hashes": [
@@ -326,21 +279,21 @@
             "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
             "version": "==0.10.1"
         },
-        "secretstorage": {
+        "rfc3986": {
             "hashes": [
-                "sha256:2403533ef369eca6d2ba81718576c5e0f564d5cca1b58f73a8b23e7d4eeebd77",
-                "sha256:f356e6628222568e3af06f2eba8df495efa13b3b63081dafd4f7d9a7b7bc9f99"
+                "sha256:50b1502b60e289cb37883f3dfd34532b8873c7de9f49bb546641ce9cbd256ebd",
+                "sha256:97aacf9dbd4bfd829baad6e6309fa6573aaf1be3f6fa735c8ab05e46cecb261c"
             ],
-            "markers": "sys_platform == 'linux'",
-            "version": "==3.3.3"
+            "markers": "python_version >= '3.7'",
+            "version": "==2.0.0"
         },
-        "setuptools": {
+        "rich": {
             "hashes": [
-                "sha256:57f6f22bde4e042978bcd50176fdb381d7c21a9efa4041202288d3737a0c6a54",
-                "sha256:a7620757bf984b58deaf32fc8a4577a9bbc0850cf92c20e1ce41c38c19e5fb75"
+                "sha256:12b1d77ee7edf251b741531323f0d990f5f570a4e7c054d0bfb59fb7981ad977",
+                "sha256:3aa9eba7219b8c575c6494446a59f702552efe1aa261e7eeb95548fa586e1950"
             ],
-            "markers": "python_version >= '3.7'",
-            "version": "==65.6.3"
+            "markers": "python_full_version >= '3.7.0'",
+            "version": "==13.0.0"
         },
         "six": {
             "hashes": [
@@ -350,21 +303,36 @@
             "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
             "version": "==1.16.0"
         },
-        "tqdm": {
+        "texttable": {
             "hashes": [
-                "sha256:5f4f682a004951c1b450bc753c710e9280c5746ce6ffedee253ddbcbf54cf1e4",
-                "sha256:6fee160d6ffcd1b1c68c65f14c829c22832bc401726335ce92c52d395944a6a1"
+                "sha256:290348fb67f7746931bcdfd55ac7584ecd4e5b0846ab164333f0794b121760f2",
+                "sha256:b7b68139aa8a6339d2c320ca8b1dc42d13a7831a346b446cb9eb385f0c76310c"
             ],
-            "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
-            "version": "==4.64.1"
+            "version": "==1.6.7"
+        },
+        "tomli": {
+            "hashes": [
+                "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc",
+                "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"
+            ],
+            "markers": "python_version < '3.11'",
+            "version": "==2.0.1"
         },
         "twine": {
             "hashes": [
-                "sha256:c1af8ca391e43b0a06bbc155f7f67db0bf0d19d284bfc88d1675da497a946124",
-                "sha256:d561a5e511f70275e5a485a6275ff61851c16ffcb3a95a602189161112d9f160"
+                "sha256:929bc3c280033347a00f847236564d1c52a3e61b1ac2516c97c48f3ceab756d8",
+                "sha256:9e102ef5fdd5a20661eb88fad46338806c3bd32cf1db729603fe3697b1bc83c8"
             ],
             "index": "pypi",
-            "version": "==3.1.1"
+            "version": "==4.0.2"
+        },
+        "typing-extensions": {
+            "hashes": [
+                "sha256:1511434bb92bf8dd198c12b1cc812e800d4181cfcb867674e0f8279cc93087aa",
+                "sha256:16fa4864408f655d35ec496218b85f79b3437c829e93320c7c9215ccfd92489e"
+            ],
+            "markers": "python_version < '3.9'",
+            "version": "==4.4.0"
         },
         "urllib3": {
             "hashes": [
@@ -374,13 +342,6 @@
             "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'",
             "version": "==1.26.13"
         },
-        "wcwidth": {
-            "hashes": [
-                "sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784",
-                "sha256:c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83"
-            ],
-            "version": "==0.2.5"
-        },
         "webencodings": {
             "hashes": [
                 "sha256:a0af1213f3c2226497a97e2b3aa01a7e4bee4f403f95be16fc9acd2947514a78",
diff --git a/README.md b/README.md
index ad1acea..f6e0412 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,7 @@ Install the package with `pip`:
 
 #### Example
 ```python
-import networkx as nx
+import networkx as nx  # igraph is also supported
 import pseudoflow
 
 G = nx.DiGraph()
@@ -38,7 +38,7 @@ sink = 2
 lambda_range = [0., 2.]
 
 breakpoints, cuts, info = pseudoflow.hpf(
-    G,  # Networkx directed graph.
+    G,  # Networkx or igraph directed graph.
     source,  # Node id of the source node.
     sink,  # Node id of the sink node.
     const_cap="const",  # Edge attribute with the constant capacity.
diff --git a/setup.py b/setup.py
index 75f90f8..a239568 100644
--- a/setup.py
+++ b/setup.py
@@ -69,7 +69,7 @@ class CTypes(Extension):
 
 setup(
     name="pseudoflow",
-    version="2020.6.1",
+    version="2022.12.0",
     classifiers=[
         "Development Status :: 3 - Alpha",
         "Programming Language :: Python :: 3",
@@ -84,7 +84,7 @@ class CTypes(Extension):
     long_description=readme,
     packages=find_packages("src"),
     package_dir={"": "src"},
-    install_requires=["six"],
+    install_requires=[],
     ext_modules=extensions,
     cmdclass={"build_ext": build_ext_new},
     zip_safe=False,
diff --git a/src/pseudoflow/python/graph_wrapper.py b/src/pseudoflow/python/graph_wrapper.py
new file mode 100644
index 0000000..5d36730
--- /dev/null
+++ b/src/pseudoflow/python/graph_wrapper.py
@@ -0,0 +1,86 @@
+from abc import ABC, abstractmethod
+
+
+class GraphWrapper(ABC):
+    def __init__(self, G):
+        self.G = G
+
+    @abstractmethod
+    def predecessors(self, i):
+        pass
+
+    @abstractmethod
+    def successors(self, i):
+        pass
+
+    @abstractmethod
+    def edge_attribute_value(self, i, j, attribute):
+        pass
+
+    @abstractmethod
+    def num_nodes(self):
+        pass
+
+    @abstractmethod
+    def num_edges(self):
+        pass
+
+    @abstractmethod
+    def edges(self, data=False):
+        pass
+
+    @abstractmethod
+    def nodes(self):
+        pass
+
+
+class NetworkxGraphWrapper(GraphWrapper):
+    def nodes(self):
+        return self.G.nodes()
+
+    def predecessors(self, i):
+        return self.G.predecessors(i)
+
+    def edge_attribute_value(self, i, j, attribute):
+        return self.G[i][j][attribute]
+
+    def num_nodes(self):
+        return self.G.number_of_nodes()
+
+    def num_edges(self):
+        return self.G.number_of_edges()
+
+    def edges(self, data=False):
+        return self.G.edges(data=data)
+
+    def successors(self, i):
+        return self.G.successors(i)
+
+
+class IgraphGraphWrapper(GraphWrapper):
+    def nodes(self):
+        for v in self.G.vs:
+            yield v.index
+
+    def predecessors(self, i):
+        return self.G.predecessors(i)
+
+    def successors(self, i):
+        return self.G.successors(i)
+
+    def edge_attribute_value(self, i, j, attribute):
+        return self.G.es[self.G.get_eid(i, j)][attribute]
+
+    def num_nodes(self):
+        return self.G.vcount()
+
+    def num_edges(self):
+        return self.G.ecount()
+
+    def edges(self, data=False):
+        if data:
+            for e in self.G.es:
+                yield e.source, e.target, e
+        else:
+            for e in self.G.es:
+                yield e.source, e.target
diff --git a/src/pseudoflow/python/hpf.py b/src/pseudoflow/python/hpf.py
index 2001f9d..abb039d 100644
--- a/src/pseudoflow/python/hpf.py
+++ b/src/pseudoflow/python/hpf.py
@@ -1,7 +1,8 @@
 from ctypes import c_int, c_double, cast, byref, POINTER, cdll
-from six.moves import xrange
 import os
 
+from pseudoflow.python.graph_wrapper import NetworkxGraphWrapper, IgraphGraphWrapper
+
 PATH = os.path.dirname(__file__)
 libhpf = cdll.LoadLibrary(os.path.join(PATH, os.pardir, "libhpf.so"))
 
@@ -12,8 +13,8 @@ def _c_arr(c_type, size, init):
 
 
 def _get_arcmatrix(G, const_cap, mult_cap, source, sink):
-    nNodes = G.number_of_nodes()
-    nArcs = G.number_of_edges()
+    nNodes = G.num_nodes()
+    nArcs = G.num_edges()
 
     nodeNames = []
     nodeDict = {}
@@ -38,14 +39,14 @@ def _get_arcmatrix(G, const_cap, mult_cap, source, sink):
             data[mult_cap] if mult_cap else 0,
         ]
 
-    return (nodeNames, nodeDict, map(lambda x: float(x), linearArcMatrix))
+    return (nodeNames, nodeDict, list(map(lambda x: float(x), linearArcMatrix)))
 
 
 def _create_c_input(
-    G, nodeDict, source, sink, arcMatrix, lambdaRange, roundNegativeCapacity
+    nodeDict, source, sink, arcMatrix, lambdaRange, roundNegativeCapacity
 ):
-    nNodes = G.number_of_nodes()
-    nArcs = G.number_of_edges()
+    nNodes = len(nodeDict)
+    nArcs = len(arcMatrix)
     c_numNodes = c_int(nNodes)
     c_numArcs = c_int(nArcs)
     c_source = c_int(nodeDict[source])
@@ -85,7 +86,6 @@ def _create_c_output():
 
 
 def _solve(c_input, c_output):
-
     hpf_solve = libhpf.hpf_solve
     hpf_solve.argtypes = [
         c_int,
@@ -125,19 +125,19 @@ def _cleanup(c_output):
 
 def _check_multipliers_sink_adjacent_negative(G, sink, mult_cap):
     for u in G.predecessors(sink):
-        if G[u][sink][mult_cap] > 0:
+        if G.edge_attribute_value(u, sink, mult_cap) > 0:
             raise ValueError(
                 "Sink adjacent arcs should have non-positive multipliers. Arc (%s, %s = sink) has a multiplier of %f. Please reverse graph."
-                % (u, sink, G[u][sink][mult_cap])
+                % (u, sink, G.edge_attribute_value(u, sink, mult_cap))
             )
 
 
 def _check_multipliers_source_adjacent_positive(G, source, mult_cap):
     for v in G.successors(source):
-        if G[source][v][mult_cap] < 0:
+        if G.edge_attribute_value(source, v, mult_cap) < 0:
             raise ValueError(
                 "Source adjacent arcs should have non-negative multipliers. Arc (%s = source, %s) has a multiplier of %f. Please reverse graph."
-                % (source, v, G[source][v][mult_cap])
+                % (source, v, G.edge_attribute_value(source, v, mult_cap))
             )
 
 
@@ -174,6 +174,14 @@ def hpf(
     lambdaRange=None,
     roundNegativeCapacity=False,
 ):
+    if "networkx" in G.__module__:
+        G = NetworkxGraphWrapper(G)
+    elif "igraph" in G.__module__:
+        G = IgraphGraphWrapper(G)
+    else:
+        raise TypeError(
+            "Graph should be networkx or igraph type. Please convert graph to one of those types."
+        )
 
     if mult_cap:
         parametric = True
@@ -188,7 +196,7 @@ def hpf(
     )
 
     c_input = _create_c_input(
-        G, nodeDict, source, sink, arcMatrix, lambdaRange, roundNegativeCapacity
+        nodeDict, source, sink, arcMatrix, lambdaRange, roundNegativeCapacity
     )
     c_output = _create_c_output()
 


Test patch:
diff --git a/tests/test_hpf.py b/tests/test_hpf.py
index 0c5b468..6a0fdbe 100644
--- a/tests/test_hpf.py
+++ b/tests/test_hpf.py
@@ -1,3 +1,4 @@
+import igraph
 import networkx as nx
 import pytest
 from pseudoflow import hpf
@@ -5,7 +6,6 @@
 
 @pytest.fixture()
 def G():
-
     G = nx.DiGraph()
     G.add_edges_from([(0, 1), (1, 2)])
 
@@ -551,3 +551,28 @@ def test_source_adjacent_arcs_with_negative_multiplier_raises_valueerror():
             lambdaRange=[0, 5],
             roundNegativeCapacity=False,
         )
+
+
+def test_for_igraph_support():
+    from pseudoflow import hpf
+
+    G = igraph.Graph()
+    G.add_vertices(range(3))
+    G.add_edges([(0, 1), (1, 2)], attributes={"const": [1, 9], "mult": [5, -3]})
+
+    source = 0
+    sink = 2
+    lambdaRange = [0.0, 2.0]
+
+    breakpoints, cuts, info = hpf(
+        G,
+        source,
+        sink,
+        const_cap="const",
+        mult_cap="mult",
+        lambdaRange=lambdaRange,
+        roundNegativeCapacity=False,
+    )
+
+    assert breakpoints == [1.0, 2.0]
+    assert cuts == {0: [1, 1], 1: [0, 1], 2: [0, 0]}