The source code and dockerfile for the GSW2024 AI Lab.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

665 lines
5.3 KiB

2 months ago
  1. /* MISP, Maximum Independent Set Problem */
  2. /* Written in GNU MathProg by Andrew Makhorin <mao@gnu.org> */
  3. /* Let G = (V,E) be an undirected graph with vertex set V and edge set
  4. * E. Vertices u, v in V are non-adjacent if (u,v) not in E. A subset
  5. * of the vertices S within V is independent if all vertices in S are
  6. * pairwise non-adjacent. The Maximum Independent Set Problem (MISP) is
  7. * to find an independent set having the largest cardinality. */
  8. param n, integer, > 0;
  9. /* number of vertices */
  10. set V := 1..n;
  11. /* set of vertices */
  12. set E within V cross V;
  13. /* set of edges */
  14. var x{i in V}, binary;
  15. /* x[i] = 1 means vertex i belongs to independent set */
  16. s.t. edge{(i,j) in E}: x[i] + x[j] <= 1;
  17. /* if there is edge (i,j), vertices i and j cannot belong to the same
  18. independent set */
  19. maximize obj: sum{i in V} x[i];
  20. /* the objective is to maximize the cardinality of independent set */
  21. data;
  22. /* These data corresponds to the test instance from:
  23. *
  24. * M.G.C. Resende, T.A.Feo, S.H.Smith, "Algorithm 787 -- FORTRAN
  25. * subroutines for approximate solution of the maximum independent set
  26. * problem using GRASP," Trans. on Math. Softw., Vol. 24, No. 4,
  27. * December 1998, pp. 386-394. */
  28. /* The optimal solution is 7. */
  29. param n := 50;
  30. set E :=
  31. 1 2
  32. 1 3
  33. 1 5
  34. 1 7
  35. 1 8
  36. 1 12
  37. 1 15
  38. 1 16
  39. 1 19
  40. 1 20
  41. 1 21
  42. 1 22
  43. 1 28
  44. 1 30
  45. 1 34
  46. 1 35
  47. 1 37
  48. 1 41
  49. 1 42
  50. 1 47
  51. 1 50
  52. 2 3
  53. 2 5
  54. 2 6
  55. 2 7
  56. 2 8
  57. 2 9
  58. 2 10
  59. 2 13
  60. 2 17
  61. 2 19
  62. 2 20
  63. 2 21
  64. 2 23
  65. 2 25
  66. 2 26
  67. 2 29
  68. 2 31
  69. 2 35
  70. 2 36
  71. 2 44
  72. 2 45
  73. 2 46
  74. 2 50
  75. 3 5
  76. 3 6
  77. 3 8
  78. 3 9
  79. 3 10
  80. 3 11
  81. 3 14
  82. 3 16
  83. 3 23
  84. 3 24
  85. 3 26
  86. 3 27
  87. 3 28
  88. 3 29
  89. 3 30
  90. 3 31
  91. 3 34
  92. 3 35
  93. 3 36
  94. 3 39
  95. 3 41
  96. 3 42
  97. 3 43
  98. 3 44
  99. 3 50
  100. 4 6
  101. 4 7
  102. 4 9
  103. 4 10
  104. 4 11
  105. 4 13
  106. 4 14
  107. 4 15
  108. 4 17
  109. 4 21
  110. 4 22
  111. 4 23
  112. 4 24
  113. 4 25
  114. 4 27
  115. 4 28
  116. 4 30
  117. 4 31
  118. 4 33
  119. 4 34
  120. 4 35
  121. 4 36
  122. 4 37
  123. 4 38
  124. 4 40
  125. 4 41
  126. 4 42
  127. 4 46
  128. 4 49
  129. 5 6
  130. 5 11
  131. 5 14
  132. 5 21
  133. 5 24
  134. 5 25
  135. 5 28
  136. 5 35
  137. 5 38
  138. 5 39
  139. 5 41
  140. 5 44
  141. 5 49
  142. 5 50
  143. 6 8
  144. 6 9
  145. 6 10
  146. 6 13
  147. 6 14
  148. 6 16
  149. 6 17
  150. 6 19
  151. 6 22
  152. 6 23
  153. 6 26
  154. 6 27
  155. 6 30
  156. 6 34
  157. 6 35
  158. 6 38
  159. 6 39
  160. 6 40
  161. 6 41
  162. 6 44
  163. 6 45
  164. 6 47
  165. 6 50
  166. 7 8
  167. 7 9
  168. 7 10
  169. 7 11
  170. 7 13
  171. 7 15
  172. 7 16
  173. 7 18
  174. 7 20
  175. 7 22
  176. 7 23
  177. 7 24
  178. 7 25
  179. 7 33
  180. 7 35
  181. 7 36
  182. 7 38
  183. 7 43
  184. 7 45
  185. 7 46
  186. 7 47
  187. 8 10
  188. 8 11
  189. 8 13
  190. 8 16
  191. 8 17
  192. 8 18
  193. 8 19
  194. 8 20
  195. 8 21
  196. 8 22
  197. 8 23
  198. 8 24
  199. 8 25
  200. 8 26
  201. 8 33
  202. 8 35
  203. 8 36
  204. 8 39
  205. 8 42
  206. 8 44
  207. 8 48
  208. 8 49
  209. 9 12
  210. 9 14
  211. 9 17
  212. 9 19
  213. 9 20
  214. 9 23
  215. 9 28
  216. 9 30
  217. 9 31
  218. 9 32
  219. 9 33
  220. 9 34
  221. 9 38
  222. 9 39
  223. 9 42
  224. 9 44
  225. 9 45
  226. 9 46
  227. 10 11
  228. 10 13
  229. 10 15
  230. 10 16
  231. 10 17
  232. 10 20
  233. 10 21
  234. 10 22
  235. 10 23
  236. 10 25
  237. 10 26
  238. 10 27
  239. 10 28
  240. 10 30
  241. 10 31
  242. 10 32
  243. 10 37
  244. 10 38
  245. 10 41
  246. 10 43
  247. 10 44
  248. 10 45
  249. 10 50
  250. 11 12
  251. 11 14
  252. 11 15
  253. 11 18
  254. 11 21
  255. 11 24
  256. 11 25
  257. 11 26
  258. 11 29
  259. 11 32
  260. 11 33
  261. 11 35
  262. 11 36
  263. 11 37
  264. 11 39
  265. 11 40
  266. 11 42
  267. 11 43
  268. 11 45
  269. 11 47
  270. 11 49
  271. 11 50
  272. 12 13
  273. 12 16
  274. 12 17
  275. 12 19
  276. 12 24
  277. 12 25
  278. 12 26
  279. 12 30
  280. 12 31
  281. 12 32
  282. 12 34
  283. 12 36
  284. 12 37
  285. 12 39
  286. 12 41
  287. 12 44
  288. 12 47
  289. 12 48
  290. 12 49
  291. 13 15
  292. 13 16
  293. 13 18
  294. 13 19
  295. 13 20
  296. 13 22
  297. 13 23
  298. 13 24
  299. 13 27
  300. 13 28
  301. 13 29
  302. 13 31
  303. 13 33
  304. 13 35
  305. 13 36
  306. 13 37
  307. 13 44
  308. 13 47
  309. 13 49
  310. 13 50
  311. 14 15
  312. 14 16
  313. 14 17
  314. 14 18
  315. 14 19
  316. 14 20
  317. 14 21
  318. 14 26
  319. 14 28
  320. 14 29
  321. 14 30
  322. 14 31
  323. 14 32
  324. 14 34
  325. 14 35
  326. 14 36
  327. 14 38
  328. 14 39
  329. 14 41
  330. 14 44
  331. 14 46
  332. 14 47
  333. 14 48
  334. 15 18
  335. 15 21
  336. 15 22
  337. 15 23
  338. 15 25
  339. 15 28
  340. 15 29
  341. 15 30
  342. 15 33
  343. 15 34
  344. 15 36
  345. 15 37
  346. 15 38
  347. 15 39
  348. 15 40
  349. 15 43
  350. 15 44
  351. 15 46
  352. 15 50
  353. 16 17
  354. 16 19
  355. 16 20
  356. 16 25
  357. 16 26
  358. 16 29
  359. 16 35
  360. 16 38
  361. 16 39
  362. 16 40
  363. 16 41
  364. 16 42
  365. 16 44
  366. 17 18
  367. 17 19
  368. 17 21
  369. 17 22
  370. 17 23
  371. 17 25
  372. 17 26
  373. 17 28
  374. 17 29
  375. 17 33
  376. 17 37
  377. 17 44
  378. 17 45
  379. 17 48
  380. 18 20
  381. 18 24
  382. 18 27
  383. 18 28
  384. 18 31
  385. 18 32
  386. 18 34
  387. 18 35
  388. 18 36
  389. 18 37
  390. 18 38
  391. 18 45
  392. 18 48
  393. 18 49
  394. 18 50
  395. 19 22
  396. 19 24
  397. 19 28
  398. 19 29
  399. 19 36
  400. 19 37
  401. 19 39
  402. 19 41
  403. 19 43
  404. 19 45
  405. 19 48
  406. 19 49
  407. 20 21
  408. 20 22
  409. 20 24
  410. 20 25
  411. 20 26
  412. 20 27
  413. 20 29
  414. 20 30
  415. 20 31
  416. 20 33
  417. 20 34
  418. 20 35
  419. 20 38
  420. 20 39
  421. 20 41
  422. 20 42
  423. 20 43
  424. 20 44
  425. 20 45
  426. 20 46
  427. 20 48
  428. 20 49
  429. 21 22
  430. 21 23
  431. 21 29
  432. 21 31
  433. 21 35
  434. 21 38
  435. 21 42
  436. 21 46
  437. 21 47
  438. 22 23
  439. 22 26
  440. 22 27
  441. 22 28
  442. 22 29
  443. 22 30
  444. 22 39
  445. 22 40
  446. 22 41
  447. 22 42
  448. 22 44
  449. 22 45
  450. 22 46
  451. 22 47
  452. 22 49
  453. 22 50
  454. 23 28
  455. 23 31
  456. 23 32
  457. 23 33
  458. 23 34
  459. 23 35
  460. 23 36
  461. 23 39
  462. 23 40
  463. 23 41
  464. 23 42
  465. 23 44
  466. 23 45
  467. 23 48
  468. 23 49
  469. 23 50
  470. 24 25
  471. 24 27
  472. 24 29
  473. 24 30
  474. 24 31
  475. 24 33
  476. 24 34
  477. 24 38
  478. 24 42
  479. 24 43
  480. 24 44
  481. 24 49
  482. 24 50
  483. 25 26
  484. 25 27
  485. 25 29
  486. 25 30
  487. 25 33
  488. 25 34
  489. 25 36
  490. 25 38
  491. 25 40
  492. 25 41
  493. 25 42
  494. 25 44
  495. 25 46
  496. 25 47
  497. 25 48
  498. 25 49
  499. 26 28
  500. 26 31
  501. 26 32
  502. 26 33
  503. 26 37
  504. 26 38
  505. 26 39
  506. 26 40
  507. 26 41
  508. 26 42
  509. 26 45
  510. 26 47
  511. 26 48
  512. 26 49
  513. 27 29
  514. 27 30
  515. 27 33
  516. 27 34
  517. 27 35
  518. 27 39
  519. 27 40
  520. 27 46
  521. 27 48
  522. 28 29
  523. 28 37
  524. 28 40
  525. 28 42
  526. 28 44
  527. 28 46
  528. 28 47
  529. 28 50
  530. 29 35
  531. 29 38
  532. 29 39
  533. 29 41
  534. 29 42
  535. 29 48
  536. 30 31
  537. 30 32
  538. 30 35
  539. 30 37
  540. 30 38
  541. 30 40
  542. 30 43
  543. 30 45
  544. 30 46
  545. 30 47
  546. 30 48
  547. 31 33
  548. 31 35
  549. 31 38
  550. 31 40
  551. 31 41
  552. 31 42
  553. 31 44
  554. 31 46
  555. 31 47
  556. 31 50
  557. 32 33
  558. 32 35
  559. 32 39
  560. 32 40
  561. 32 46
  562. 32 49
  563. 32 50
  564. 33 34
  565. 33 36
  566. 33 37
  567. 33 40
  568. 33 42
  569. 33 43
  570. 33 44
  571. 33 45
  572. 33 50
  573. 34 35
  574. 34 36
  575. 34 37
  576. 34 38
  577. 34 40
  578. 34 43
  579. 34 44
  580. 34 49
  581. 34 50
  582. 35 36
  583. 35 38
  584. 35 41
  585. 35 42
  586. 35 43
  587. 35 45
  588. 35 46
  589. 35 47
  590. 35 49
  591. 35 50
  592. 36 37
  593. 36 39
  594. 36 40
  595. 36 41
  596. 36 42
  597. 36 43
  598. 36 48
  599. 36 50
  600. 37 38
  601. 37 41
  602. 37 43
  603. 37 46
  604. 37 47
  605. 37 48
  606. 37 49
  607. 37 50
  608. 38 41
  609. 38 45
  610. 38 46
  611. 38 48
  612. 38 49
  613. 38 50
  614. 39 43
  615. 39 46
  616. 39 47
  617. 39 48
  618. 39 49
  619. 40 43
  620. 40 45
  621. 40 48
  622. 40 50
  623. 41 42
  624. 41 43
  625. 41 44
  626. 41 45
  627. 41 46
  628. 41 48
  629. 41 49
  630. 42 43
  631. 42 44
  632. 42 46
  633. 42 48
  634. 42 49
  635. 43 45
  636. 43 46
  637. 43 48
  638. 43 50
  639. 44 45
  640. 44 48
  641. 45 46
  642. 45 47
  643. 45 48
  644. 46 49
  645. 47 49
  646. 47 50
  647. 48 49
  648. 48 50
  649. 49 50
  650. ;
  651. end;