Skip to content

Performance is far from satisfying #344

@WalterMadelim

Description

@WalterMadelim

The performance of the utility functions are not satisfying (they don't give results in reasonable time).
Especially the in function, which should has be very easy to give results (If use Gurobi to write a simple convex-combination program, this should be verified in a second).

I conduct the experiment in Euclidean-16 space. The poly is defined by 32 points defined in the 16-by-32 matrix yM.
A test point (in the 16-dim space) is defined in the vector y.
Please check out the code, it just doesn't give results.

import Polyhedra
import Gurobi
function m2vov(mat) return [Vector(c) for c in eachcol(mat)] end
yM = [24.46879703394664 2.616114091880524 2.4715185809304274 2.1396187950919554 2.174059532246913 2.19917201685415 2.3456480253453456 3.1445161566848703 2.0940064396589553 2.620015012823288 2.546388339946783 2.476192287013689 2.034122904925076 2.9006777162073196 2.4378442607921924 2.2501508126527257 0.0 1.667897184448773 1.6159109682973325 3.0759173066528156 2.4439892067127738 2.301326508581662 2.4969339341011727 1.7617818667462155 2.5218026526965542 1.6423808178251933 2.1409668026456985 1.9950352639386895 2.0196361398727856 1.6585134269440789 2.1359418837184143 2.784909279614445; 2.5402917160039116 25.77333322828717 1.90134848722727 2.528663424634159 2.805822501169715 2.313456498322179 2.3903788690256293 1.8611241982142337 2.198177100434352 2.2516164134797783 1.8895526894410994 2.2266199802427753 2.7347012112426667 2.3475699725927126 2.402573680091464 1.6058749874696356 2.088297102610564 0.0 2.7650148331043987 1.7735200450503765 1.5726364014575052 2.257643507849035 1.7817474439622578 1.3629385740274143 2.356721679666441 1.9543066036370536 2.8295146338254216 2.4716914708486244 1.715931176888029 2.9684249753599894 2.3831906391086903 3.2074000552224784; 2.1805325502239885 1.6861848323974435 26.1911579369055 2.3462751464608522 0.7078452281244294 2.322697282767246 2.206375064167377 2.956814574699886 1.9235144021312605 2.36010111451448 2.329268948524775 2.335586232987129 1.7484310459805685 2.1828201910382847 1.6747505459380199 2.0781187063692466 2.0322214126013702 2.3208414265591486 0.0 1.8110585291319679 3.4077462083038226 2.025205368971515 1.3193371501119944 1.2505818484823985 3.083141715549766 1.3815539204906573 2.0637868671266495 1.6871995384071834 2.1473055171714828 1.8822407002022314 2.4971835777488467 2.133474622372291; 1.9128039934989958 2.377670998917811 2.4104463755743315 28.61127852323967 2.06742854649278 2.87074982707165 2.3141799082565377 2.192627675028608 2.592091279176202 1.8673780860783564 2.266917717648885 2.6622905011152302 2.398353368726963 1.9658131184221825 1.6803305528960926 0.6155905008752687 2.382519663227918 2.027779569354112 1.8358369846378675 0.0 2.1921300296238906 1.3618519277375332 2.0954675458825536 1.6287886007478771 1.5023878453611568 2.561393373125879 2.4729219001407072 1.7024688754559145 2.031878289407704 2.199646777827622 2.4275104029368664 3.6271552772898867; 2.094611185941017 2.8021965307404324 0.9193829125249725 2.214795001779845 28.954640722880548 1.9713107731682806 2.125607932833218 2.1350957114879594 2.745738139100508 1.9328599586044524 2.215487388193955 1.8876398702511683 2.427472932375576 1.8752115765965518 2.4490907931788657 2.0593735306220013 2.053258115175874 1.8114024036111667 3.3044117915002094 2.7688311084923454 0.0 2.699919051437521 3.204257418177694 2.5086652869076627 2.2425882317868804 2.63036842063185 2.1681555648850352 2.6402535453772344 2.0534714279580517 2.369608306063273 1.291052181305684 2.51183274847302; 2.1039529101756598 2.294059767520302 2.5184642067951954 3.0023455219861193 1.9555400127956877 26.34922575839723 2.9796143724749107 1.7701555593719889 1.3964717726376432 2.407807075481056 2.9469359370523294 2.863174089498839 2.555820509557353 2.446276176970783 1.802049779597186 1.944649401349618 2.342187074374172 1.9113775974681877 2.1076319016008713 1.461643266868386 2.9634579531379552 0.0 1.1194864555363484 2.392396876922496 3.1366731692306438 2.110708350651228 1.475389164772464 1.4360259657006254 2.19126388948825 1.5824546925191378 2.7129042426017635 2.466036158105427; 2.254002560074045 2.3745557796309424 2.4057156296025157 2.449349244578196 2.113410813867813 2.9831880138821005 24.04357367738752 2.0980367478740356 1.8964416144238607 2.3269100986755835 2.131810621718956 2.3531741173032263 2.078872748226011 2.6704474715365416 2.1068019980417647 2.263490429833156 1.8621579051124906 2.375477733946526 2.6687401263047428 1.9024319078255438 2.5629222788336192 1.7185617582207757 0.0 2.6361691443339508 2.38139801559271 1.50484370815399 1.9394941817068432 2.015609298264674 2.6348999158093847 1.8859554782356966 2.5118314703062947 2.237877123372016; 2.898736171502773 1.6911665889087502 3.0020206202242274 2.1736624914394707 1.9687640726117577 1.6195946808683814 1.9439022279632387 28.72969685422756 1.2602161156134692 2.05516783938274 2.1044049301008347 1.9152487658432384 1.7561113160230233 1.7843530811425135 2.0483643547967585 1.8673613015213006 1.0521385771013585 2.6616336916346017 0.4450894695535121 2.839681616674711 2.0430967153567314 3.404474344709164 2.778712365172625 0.0 3.0691803386758 2.1567815855728467 2.5648017355024257 2.038926927760925 2.9407620656905245 2.2524754592842675 2.719581657942814 1.9387848620217674; 1.7703451927259746 1.9503382293779847 1.8908391859047202 2.4952448338361815 2.5015252384734237 1.1680296323831536 1.664425832762181 1.1823348538625875 24.91877770367074 1.8322590865596118 1.8143336830252748 0.8491991365961374 2.6734429250189855 1.982834427472362 1.7665949531418257 1.8998356534736007 2.3394628819259835 1.955250861132444 2.6852398754583 1.848931156081585 1.2545709048011007 2.837780050832832 2.3386498331808903 3.18640135128203 0.0 2.081507500596683 2.5498361596356385 2.643476619630957 1.758543306972774 1.928226464919106 2.1186570791610984 1.6502767988515474; 2.3109829952107295 2.0184067717438325 2.3420551276083605 1.785160870058758 1.70327628729779 2.1939941645469876 2.109523546334325 1.9919158069522789 1.846888315880032 25.916012588042015 2.2447112071584234 2.2539584732552322 2.0652906108887845 2.2028834398499653 1.522808506487769 1.879291269323549 2.1230973126685306 2.342840667254813 1.9347729672343743 2.1851889476393085 2.8011442375983733 1.8476338427878145 1.8740031316595873 2.134107516423211 1.7808100020507023 0.0 1.5307066121840645 1.4324395498874471 2.0481455889612667 2.0938865998999856 2.15985033184296 1.8875746035679364; 2.363780670262002 1.7827673956329313 2.437647309546433 2.3111248495570638 2.1123280648150695 2.8595473740460386 2.040848417305476 2.167577245598151 1.955387260273473 2.3711355550862008 23.78382670836272 2.753412517745913 1.3057464246763875 1.8565194824226017 2.1359306430353726 1.8295890775709562 0.8989541914940385 2.3374382244487113 1.9814043371765009 2.041106240727646 2.112621586177074 1.1864999020711906 2.206251741044022 2.492769728596206 2.49629778691924 1.5852612792576715 0.0 2.2060485484301284 3.416891558802725 3.2085290175518097 1.9911912042246185 1.7221254010705804; 2.334793607011518 2.1610436761172176 2.4851735836913975 2.7477066227060196 1.8256895365548929 2.8169945161751584 2.303420902572356 2.019630071023166 1.0314617035269458 2.4215918108656194 2.7946215074285234 24.499036285957636 1.4471919930307964 2.380651051268325 2.44803841298941 1.945345768906293 2.02626839775254 2.0995381425884188 1.8785624618424592 1.6585635540887769 3.2793268165868983 1.9924921925873669 1.987377755321707 2.301562513905481 3.557869123443761 2.058212196959744 1.6479057857531179 0.0 2.740474399490953 2.040373613387037 2.3616667411036905 2.5784671778303165; 1.683170517433554 2.4595711996277583 1.6884646891954864 2.274215782828401 2.1559688911899504 2.3000872287443217 1.8195658260057899 1.6509389137135997 2.646151784460443 2.0233702410098218 1.1374017068696478 1.2376382855414456 25.759105486030887 2.2081313944270664 1.695339406230303 2.4778804538262715 2.4195788546231873 2.2583208673056245 2.288223054573641 2.133390766052656 2.113707644410414 1.9211675838872893 2.1916601043688946 2.3592827318290817 1.8704831897800802 1.8668042090698613 3.098958515117322 2.8998232996587188 0.0 1.2945334154335588 2.305395823734276 1.6341209042144331; 2.5429367129482165 2.0656513452102248 2.1160652184856232 1.8348869167560407 1.5969189196433464 2.1837542803901715 2.40435193354874 1.6723920630655096 1.9487546711462396 2.154174454203423 1.681386148848282 2.1643087280113944 2.2013427786594866 26.655805570490543 1.6799363287441271 2.1571789599771924 1.1287494348842033 1.3730091780336349 1.9512263713269575 1.5905548531650144 2.421545552989113 1.7468603992505054 1.3438921115453646 2.329318165776871 1.5669758289681102 1.6711571238175458 2.1136447190265906 1.2627314229160125 2.2488929601767627 0.0 2.1826031964967583 1.7687748338050844; 2.2390512255685198 2.2796030207444042 1.7669435414207864 1.7083523192653804 2.329746104261089 1.6984758510520035 1.9996544280893933 2.0953513047551837 1.8914631648511324 1.633047488876655 2.1197452774964813 2.3906440577679082 1.8474987584981521 1.8388842967795562 23.698895709160123 2.154095383069975 1.967172421071858 1.990464079233279 2.0765284035107814 2.2539286268387917 1.361050257070218 2.8340294755191713 2.238639792647835 2.0160094529845534 1.9486517593084134 2.5542247006696166 2.0909810129814432 1.6290283153478742 2.616066307310768 1.8652636985554734 0.0 2.49434483081084; 1.8391134466074388 1.2706599973009627 1.9580673710303997 0.4313679364229429 1.727784510882612 1.6288311419828216 1.9440985290591701 1.7021039206581121 1.8124595343612935 1.7772859208908216 1.6011593812104523 1.6757070828631775 2.4177954752725066 2.103882597191008 1.9418510522483616 25.2048806230229 2.3169501162571797 2.1981245468465236 1.987924648188344 3.239526015917086 2.237082180243411 1.9290237836974877 1.4004575138200244 2.613909339743923 1.9266805848477344 2.172947403998948 2.2897387334805397 2.194486960760201 1.276428428595403 1.6947394740557458 1.6187583272220483 0.0]
y = [2.213942268387555, 2.24840822001899, 2.0761192498440577, 2.1006090176636554, 2.159991089284715, 2.2444441525587444, 2.215193174509882, 2.0794736136606295, 2.0619575537781043, 1.9267183916544581, 2.094740438570332, 2.15580982236171, 1.9790865851844102, 1.975552982004878, 2.1671040201646368, 2.009795928246596]

v = Polyhedra.vrep(m2vov(yM));
poly = Polyhedra.polyhedron(v);
Polyhedra.hrep(poly)#  way too slow
Polyhedra.in(y, poly) #  way too slow
Polyhedra.ininterior(y, poly) #  way too slow
Polyhedra.volume(poly) #  way too slow

Could you give any method to address this issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions